Re: [orbitcpp-list] to hell with inheritance ;)
Status: Beta
Brought to you by:
philipd
|
From: Phil D. <ph...@us...> - 2000-03-06 18:51:20
|
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?
Phil.
|