Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
Private inheritance is an uncommonly used (of three) modes of inheritance. Private inheritance denotes a 'is-implemented-in-terms-of' relationship between derived class and base class [1]. Private inheritance is usually inferior to composition [1].
There are no real-world examples for Private inheritance, as it means nothing during software design, only during software implementation [1]. In the example below Widget is not a kind of Timer, but it uses some of the features of Timer.
struct Widget : private Timer //A derived class, private inheritance |
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.