- If you want all member variables and
member functions of a base class to retain their status in a
derived class,
then make the derivation public by instantiating the
following pattern:
class derived-class name : public base-class name { ... }
- If you want to elevate all public member variables and
member functions in a base class to protected status
in a derived class,
then make the derivation protected by instantiating the
following pattern:
class derived-class name : protected base-class name { ... }
- If you want to elevate all public and protected member variables and
member functions in a base class to private status
in a derived class,
then make the derivation private by instantiating the
following pattern:
class derived-class name : private base-class name { ... }