Multiple inheritance and virtual method tables

If a class derives from more than one class and the parent classes have virtual methods, then the vtable for the derived class will be a combination of the vtables of its parents arranged in the order in which the parent classes were listed in the derivation list:

If the object is accessed through a base class pointer, the vptr has access to the part of the vtable relevant to that base class.

Get Beginning C++ Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.