DIP66 v1.1 (Multiple) alias this.

mogu via Digitalmars-d digitalmars-d at puremagic.com
Sun Jun 26 17:13:46 PDT 2016


On Friday, 8 May 2015 at 13:57:56 UTC, Andrea Fontana wrote:
> 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 :)

I need it too, and also do static inheritance.
http://wiki.dlang.org/DIP84


More information about the Digitalmars-d mailing list