DIP66 - Multiple alias this

Mike slavo5150 at yahoo.com
Thu Oct 1 00:40:05 UTC 2020


On Wednesday, 30 September 2020 at 07:54:39 UTC, Paolo Invernizzi 
wrote:
> On Wednesday, 30 September 2020 at 01:36:59 UTC, Mike wrote:
>> 1.  Deprecate `alias this` for classes, and implement multiple 
>> `alias this` for structs.  That will give users the 
>> composition feature they need, and in addition, because 
>> structs cannot inherit, it removes the complexity Walter spoke 
>> of.
>
> This!
>
> We've never used alias this for classes, I'm wondering if 
> there's something like that in Phobos, or in other projects ...

To be more precise, you don't actually have to deprecated alias 
this for classes.  You could keep singular alias this for classes 
and then add multiple alias this for structs.  That may satisfy 
the "add, don't change" crowd, while still giving users the 
struct composition features that D currently lacks.


More information about the Digitalmars-d mailing list