Re: [orbitcpp-list] to hell with inheritance ;)
Status: Beta
Brought to you by:
philipd
|
From: Phil D. <ph...@us...> - 2000-03-06 18:57:57
|
Phil Dawes wrote:
>
> Andreas Kloeckner wrote:
> >
> > Example:
> >
> > A
> > / \
> > B C
> > \ /
> > D
> >
> > In this case, the compiler might generate something like: (A,B,C
> > straightforward, with inheritance)
> >
> > class D : B {
> > operator C { reinterpret_cast... blah... }
> > stub_of_C_1(blah) { reinterpret_cast<C *>(this)->stub_of_C_1(blah); }
> > stub_of_C_2(blah) { reinterpret_cast<C *>(this)->stub_of_C_2(blah); }
> > ...
> > rest of D
> > };
> >
> > what do you think?
> >
>
> Yep, I was coming to that conclusion today on the train home from work.
> BTW, what does virtual inheritance do if you don't define any virtual
> methods?
>
Having thought for a minute, I've realised that it must still instrument
the object instance with offset pointers to member state otherwise the
whole thing wouldn't work polymorphically. Doh!
Phil.
|