Base.h:
Код: Выделить всё
class Base
{
public:
Base();
protected:
virtual void Create() {}
};
Код: Выделить всё
Base::Base()
{
Create();
}
Код: Выделить всё
class Child : public Base
{
protected:
void Create() override;
};
Код: Выделить всё
void Child::Create()
{
// Work happens here
}
Код: Выделить всё
CreateПодробнее здесь: https://stackoverflow.com/questions/421 ... ing-called
Мобильная версия