DIP1000

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Thu Sep 15 14:14:56 PDT 2016


On 15.09.2016 14:57, Andrei Alexandrescu wrote:
>
>> Multiparameter functions can be declared to be equivalent to
>>
>> struct P { S* s; int* r; }
>> P p;
>> p.s = &s;
>> p.r = getPayload(s);
>> f(p); //as if f(S*,int*)
>
> Thanks for making this point.

This fails when considering scope and return annotations though. 
Parameters can be annotated or not annotated with scope/return scope 
independently, but the struct can either be annotated or not annotated, 
the fields cannot be treated independently (which is one of the 
weaknesses of DIP1000).


More information about the Digitalmars-d mailing list