D vs C++ classes?

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Tue Jun 22 10:40:44 UTC 2021


On Tuesday, 22 June 2021 at 09:04:05 UTC, IGotD- wrote:
> It's because the diamond problem. The diamond problem is purely 
> an academic problem and it very seldom happens in the real 
> world and if it does you probably did something wrong in your 
> design. Happen to me once in 30 years because I messed up. 
> Multiple inheritance is often flat, which means that one class 
> inherits from several others at the same level. Instead of 
> disallow multiple inheritance you can disallow the diamond 
> pattern.

It is usually best to not use multiple inheritance, but it would 
be better for the D eco system if D classes map to C++ since they 
are so close anyway.





More information about the Digitalmars-d mailing list