D vs C++ classes?

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Mon Jun 28 21:03:21 UTC 2021


On Monday, 28 June 2021 at 20:35:25 UTC, solidstate1991 wrote:
> Multiple inheritance induces a lot of headaches (added 
> complexity, diamond inheritance, etc.), and even C++ devs try 
> to avoid it at all costs. It rarely has any real-life use, that 
> couldn't be solved with interfaces and mixins.

That isn't the point (if it is true). And actually, C++ stdlib 
uses it. Some C++ devs avoid virtual in general though, but that 
is another issue.

The point is that you need multiple inheritance to unify D 
classes with C++ classes, but you don't have to use it if you 
don' want to, so there is no cost to having it. So basically only 
one big benefit, and no real disadvantages.



More information about the Digitalmars-d mailing list