August 2012
Intermediate to advanced
976 pages
30h 17m
English
The derivation list in a derived class can contain more than one base class:
class Bear : public ZooAnimal {class Panda : public Bear, public Endangered { /* ... */ };
Each base class has an optional access specifier (§ 15.5, p. 612). As usual, if the access specifier is omitted, the specifier defaults to private if the class keyword is used and to public if struct is used (§ 15.5, p. 616).
As with single inheritance, the derivation list may include only classes that have been defined and that were not defined as final (§ 15.2.2, p. 600). There is no language-imposed limit on the number of base classes from which a class can be derived. A base class may appear only once in a given derivation list.
Read now
Unlock full access