DIP66 v1.1 (Multiple) alias this.

Andrea Fontana via Digitalmars-d digitalmars-d at puremagic.com
Fri May 8 06:57:54 PDT 2015


On Saturday, 27 December 2014 at 12:28:34 UTC, Joseph Rushton 
Wakeling wrote:
> On 26/12/14 19:53, Daniel N via Digitalmars-d wrote:
>> Anyway considering the new ways of working, when using the 
>> -dip switch for the
>> initial few releases, there is ample time to perfect all 
>> details.
>
> Potentially related issue, regarding implicit conversion.  
> Given a struct as follows:
>
>     struct Integer
>     {
>         int i_;
>
>         alias i_ this;
>     }
>
> Can anyone explain to me why this works:
>
>     Integer i = Integer(3);
>     i = 5;
>
> ... but this doesn't:
>
>     Integer i = 5;
>
> It seems unintuitive, in the circumstances.

Is "multiple alias this" implementation planned in near future? 
It could be useful for a project of mine :)



More information about the Digitalmars-d mailing list