Copy Constructor DIP

Andrei Alexandrescu SeeWebsiteForEmail at erdani.com
Fri Jul 13 16:21:20 UTC 2018


On 7/13/18 12:06 PM, xenon325 wrote:
>  From the DIP:
>> The copy constructor declaration will be recognized by the parser when 
>> the tokens @, implicit, this are encountered exactly in this order
> 
> Regarding "exactly in this order". The code below would be allowed and 
> define copy c'tor for `A` and usual c'tor for `B` ?
> 
> 
>      struct implicit{}
> 
>      struct A {
>          @safe @implicit this(ref A) {}
>      }
> 
>      struct B {
>          @implicit @safe this(ref B) {}
>      }

We'll change that part to accept the standard attribute syntax.



More information about the Digitalmars-d mailing list