<<< Inheritance vs. templates | Index | Implicit conversion, upcast >>> |
Compiler-generated assignment and copy constructors include the base classes automatically.
However, if you define your own, they are not automatically inherited.
Thus, you have to chain to the base classes manually. For example,
Derived& Derived::operator=( Derived const& other ) { if ( &other == this ) return *this; Base::operator=( other ); }
<<< Inheritance vs. templates | Index | Implicit conversion, upcast >>> |