[Issue 177] remove inheritance protection

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jun 13 08:41:27 PDT 2006


http://d.puremagic.com/issues/show_bug.cgi?id=177





------- Comment #4 from benoit at tionex.de  2006-06-13 10:41 -------
(In reply to comment #3)
> How is the lack of multiple inheritance a reason that it doesn't make sense?

A public inheritance is good for "is a" relationship. a private inheritance in
C++ can be used for a "is implemented with" relationship. 

you write a base class with some functionality, so the user can simply derive
from and has this functionality available for a concrete implementation class. 
But what is this for if you give the user of your class the restriction, not to
be able to derive from another public baseclass. Than this is not useful, and
so the functionality should be implemented better in an other way. A member
object is allways possible (and used in java). Perhaps mixins can be a better
solution for many cases.

Or do you know a use-case for this feature?


-- 




More information about the Digitalmars-d-bugs mailing list