I'd like to do the following:
void do_stuff(Base* base_ptr) {
// here I need the overridden methods
base_ptr->init();
}
class Base {
Base() {
do_stuff(this);
}
virtual void init() {}
};
class Derived : public Base {
virtual void init() override {
// Derived specific init
}
}
But all I get are calls to Base::init(), is it even possible to do what I intend?