|
 |
Darren New <dne### [at] san rr com> wrote:
> Warp wrote:
> > Why not disallow diamond inheritance?
> Technically, you can't, since there's a common base type for all objects
> in those languages.
No, there isn't: The so-called "interfaces" are not inherited from the
common base class. What would stop these interfaces from having member
variables and function implementations?
Besides, does this common base class have member variables? If not,
there is no problem with diamond inheritance.
And even if it had, since it's an automatic inheritance forced
by the compiler, it's perfectly possible for it to automatically do
the same thing as C++'s "virtual inheritance" does. That is, even if
you multiple-inherit, there's still only one base class part in the
resulting objects and everything referring to this base class uses
this unique instantiation.
--
- Warp
Post a reply to this message
|
 |