C++ - Public vs. protected vs. private inheritance
With public inheritance:
- public members in the base class, stay public in the derived class
- protected members in the base class, stay protected in the derived class
- private members in the base class, are hidden to the derived class
With protected inheritance:
- public members in the base class, become protected in the derived class
- protected members in the base class, become protected in the derived class
- private members in the base class, are hidden to the derived class
With private inheritance:
- public members in the base class, become private in the derived class
- protected members in the base class, become private in the derived class
- private members in the base class, are hidden to the derived class