Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) inheritance

 

Inheritance is a technique to re-use members of a class.

 

There are multiple types of inheritance:

 

There are three modes of inheritance:

  1. public inheritance, an 'is-a-kind-of' relationship, the most commonly used mode of inheritance
  2. protected inheritance, an obscure type of relationship
  3. private inheritance, an 'is-implemented-in-terms-of' relationship [1]

 

 

 

 

 

Examples

 

 

 

 

 

 

advice

 

 

 

 

 

 

Notes to self

 

 

 

 

 

 

External links

 

 

 

 

 

 

References

 

  1. Scott Meyers. Effective C++ (3rd edition).ISBN:0-321-33487-6. Item 39: 'Use private inheritance judiciously'
  2. Herb Sutter, Andrei Alexandrescu. C++ coding standards: 101 rules, guidelines, and best practices. 2005. ISBN: 0-32-111358-6. Chapter 34: 'Prefer composition to inheritance'.

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict