I am extending the class provided by the third part library. The class, let's call it Foo , has a reset() method that can be called to restart the behavior of Foo . The reset() method is also used inside the class.
class Foo { public: void reset () { } void something () { reset(); } };
So far, I needed to overload the reset() method to reset add my extra functions:
class Bar : public Foo { public: void reset() { Foo::reset(); } };
Unfortunately, since the Foo::reset() method is not virtual, by calling Bar::something() , I call the Foo::reset() method instead of Bar::reset() .
Is there a way (other than overloading Foo::something() ) to make it back-virtual?
c ++ virtual
Dacav
source share