I have always appreciated C++ multiple-inheritance (especially when programming with Java Very Happy). Anyway, it has a cost as you correctly demonstrate.
Multiple inheritance is really no bad thing, that's not what I wanted to demonstrate :lol:
My point was that
multiple virtual inheritance is still more expensive than (single) virtual inheritance.
In fact, I believe that multiple inheritance is one of the
best features of C++, you only have to keep a few things in your head. One such thing is the "Diamond of Dread", and another example is the extra memory cost for virtual base classes.
Let's not forget that neither Stroustrup is stupid, nor are the ISO committee members, so if multiple inheritance was
really that bad, then it wouldn't have been implemented in the first place, and it would never have made it into the standard
Java has no multiple inheritance mainly for three reasons:
1. A compiler (and a virtual machine) supporting multiple inheritance is harder to implement and requires more resources.
2. C++ was designed to write software that runs country-wide call-centers, international airports, and airline booking systems. Java was designed to run embedded smart appliances ( = toasters with internet access).
3. Multiple inheritance (C++ in general) is not fool-proof. You really have to know what you do, and you really have to think about what you do, or your life will be a very unhappy one. Java, however, was explicitely designed for fools. Java does not require the programmer to think about "dangerous" things (in fact, it does not even allow it). The good side (and certainly one reason why Java was so successful) is that this avoids many problems alltogether.