The standard does not define how virtual functions are actually implemented, only how they should behave. So what you are asking for entirely depends on the compiler you are using.
GCC will in theory most likely create two vtables (one for B
and one for D
) and three vptrs (one for each of the object instances d1
, d2
, d3
).
Have a look here: http://en.wikipedia.org/wiki/Virtual_method_table