Yes, sometimes this is done in serialization:
class A{ int x; public: A () : x(0) {} virtual void out( Output* o ) { o->write(x); } virtual void in( Input* i ) { i->read(&x); } } class B : public A{ int y; public: B () : y(0) {} virtual void out( Output* o ) { A::out(o); o->write(y); } virtual void in( Input* i ) { A::in(i); i->read(&y); } }
This is because you want to read / write data for both the parent class and the derived class.
This is a real example of when a derived class should also call the functionality of the base class, as well as add something else to it.
source share