What would break if class was merged with struct

Ola Fosheim Grøstad via Digitalmars-d digitalmars-d at puremagic.com
Sun May 28 01:42:24 PDT 2017


On Sunday, 28 May 2017 at 08:24:50 UTC, Iain Buclaw wrote:
> Strictly speaking, this already is the case.
>
>     Something sth = new Something (...);
>
> all that is really doing is just:
>
>     struct Something* sth = new Something (...);
>
> You just aren't exposed this in the language.

Right, but since the language now is more powerful than it was in 
D1, it should be possible to implement class references as a 
templated struct, right? So there is no longer a need for this 
special casing of class vs struct.

The only thing you need to do is modify "new" to recognize it. I 
think?



More information about the Digitalmars-d mailing list