I found those two terms in the book of Meyers, but what is the difference, thanks in advance for any help
+1
A:
Interface inheritance is public inheritance, while implementation inheritance is private inheritance.
If class B publicly inherits from A, B is an A: it inherits the whole interface of A, and a (reference/pointer to) a B object can be automatically be upcasted to A, and used wherever an object of A is expected. However, if B privately inherits from A, B is-implemented-in-terms-of A: only the implementation of A is inherited, not its interface. Thus (references/pointers to) B objects can not be used in places where A objects are expected.
Péter Török
2010-09-22 23:09:28
Note that `private` inheritance should only be used in a very restricted set of cases (mainly: virtual override / Empty Base Optimization). "Implementated in terms of" relationship is best implemented by composition.
Matthieu M.
2010-09-23 08:22:20
@Matthieu, correct, thanks for mentioning.
Péter Török
2010-09-23 08:47:40