Re: Virtual Inheritance
On Sep 10, 7:14 pm, Juha Nieminen <nos...@thanks.invalid> wrote:
Victor Bazarov <v.baza...@comcast.invalid> wrote:
The memory layout and vptr are implementation
details and cannot really be generalized.
You mean there are significantly different implementations of
vtables and virtual inheritance in different
compilers/systems?
It's been quite some time since I looked at them, but at least
in the past there were (where virtual inheritance was involved).
I would be interested in seeing a couple of examples of such
significantly different implementations.
Not particularly current, but CFront and HP's aCC used very
different techniques---g++ was also quite different from CFront.
(I'm sorry I don't remember more about the actual layouts---all
I do remember was that for a small set of test classes, along
the lines of:
class VB {};
class R : public virtual VB {};
class L : public virtual VB {};
class D : public R, public L {};
, but with an int in each class (and a virtual destructor,
etc.), sizeof(D) varied by a factor: CFront was twice the size
of g++ (and IIRC, aCC was very close to g++).
--
James Kanze