Why can't we derive struct's?

Walter Bright newshound2 at digitalmars.com
Fri Dec 21 03:08:57 UTC 2018


On 12/20/2018 6:55 AM, Steven Schveighoffer wrote:
> really we should 
> implement multiple-alias-this and that problem would be solved.

And create a host of other problems. Multiple alias this is multiple inheritance 
with all of C++'s problems with it, and more, because then you wind up with two 
(count 'em, 2!) multiple inheritance hierarchies. Madness. Even single alias 
this has spawned a fair amount of wreckage in bugzilla, because people use it 
for multiple inheritance which it was never intended for.

MI is just a bad idea. It's best to just think of another way to structure the 
data - even if you get it to work, it'll just confuse the poor schlub who has to 
maintain the code.


More information about the Digitalmars-d mailing list