As discussed previously, the inheritance process causes a new derived class to be created that is made up of the members of the base class(es) plus any new members the derived class adds. In a multiple-inheritance situation, it is possible to construct an inheritance graph where the same base class is part of more than one of the derived classes. Figure 9.4 shows such a graph.
In Figure 9.4, pictorial representations of the components of CollectibleString and CollectibleSortable are shown. However, the base class, Collectible, is in CollectibleSortableString through the CollectibleString path and the CollectibleSortable path. To eliminate this kind of redundancy, such classes can be declared as virtual base classes when they are inherited.
For information about declaring virtual base classes and how objects with virtual base classes are composed, see “Virtual Base Classes” on page 268.