Standard Template Library Programmer's Guide

phc -- Memory Layout for Multiple and Virtual Inheritance -- Edsko de Vries
Warning. This article is rather technical and assumes a good knowledge of C++ and some assembly language. In this article we explain the object layout implemented by gcc for multiple and virtual inheritance. Although in an ideal world C++ programmers should not need to know these details of the compiler internals, unfortunately the way multiple (and especially virtual) inheritance is implemented has various non-obvious consequences for writing C++ code (in particular, for downcasting pointers, using pointers to pointers, and the invocation order of constructors for virtual bases). If you understand how multiple inheritance is implemented, you will be able anticipate these consequences and deal with them in your code. Multiple Inheritance First we consider the relatively simple case of (non-virtual) multiple inheritance. Using a UML diagram, we can represent this hierarchy as Note that Top is inherited from twice (this is known as repeated inheritance in Eiffel). This works out nicely.
comp.lang.c Frequently Asked Questions
Related:
Related: