Of course:
void SomeFunc()
{
Base::SomeFunc();
std::cout << "Hello from child\n";
}
Btw, since it is Base::SomeFunc()not declared virtual, Derived::SomeFunc()hides it in the base class, and does not override it, which will undoubtedly cause some unpleasant surprises in the long run. Therefore, you can change your ad to
public: virtual void SomeFunc() { ... }
It also does this automatically Derived::SomeFunc() virtual, although you can explicitly declare it for the purpose of clarity.
source
share