DIP69 - Implement scope for escape proof references

Nick Treleaven via Digitalmars-d digitalmars-d at puremagic.com
Tue Dec 9 06:23:48 PST 2014


On 08/12/2014 15:53, Steven Schveighoffer wrote:
>>    scope ref int foo(ref int x);
>>
>> will do it.
>
> So:
>
> int x;
>
> foo(x) += 1;
>
> will compile?

Yes, because foo's argument is not scope, it can be returned.


More information about the Digitalmars-d mailing list