How to call base class copy constructor from a derived class copy constructor?

slow picture slow · Jun 26, 2013 · Viewed 33.9k times · Source

Just like in the title, how do you call a base class copy constructor from a derived class copy constructor?

Answer

perreal picture perreal · Jun 26, 2013

You can specify base initialization in the initialization list:

Derived:: Derived( const Derived& other ): Base( other )
{ /* ... */ }