Lecture overview -- Keyboard shortcut: 'u'  Previous page: Is repeated inheritance possible? No! -- Keyboard shortcut: 'p'  Next page: Base class access -- Keyboard shortcut: 'n'  Lecture notes - all slides together  Annotated slide -- Keyboard shortcut: 't'  Alphabetic index  Help page about these notes  Course home    Abstraction Mechanisms, Part 2 - slide 19 : 24

Shared base class: Virtual base

Per default you get replicated base classes in C++

It is also possible for B and C to to share their A parts in a D-object

To see this image you must download and install the SVG plugin from Adobe.In Firefox please consultthis page.
virtual-1.cc
Illustration of shared, virtual, base class A.
virtual-1-output
Program output.

Every base class of a given name that is specified to be virtual will be represented by a single object of that class, §15.2.4