[ ] novtable |
struct __declspec(novtable) IDrawable
{
virtual void Draw() const = 0;
};
// , IDrawable:
class Rectangle : public IDrawable
{
virtual void Draw() const override
{
}
int width;
int height;
};
IDrawable* drawable = new Rectangle;
drawable->Draw(); // Rectangle::Draw
https://habr.com/ru/post/442340/?utm_source=habrahabr&utm_medium=rss&utm_campaign=442340