DIP69 - Implement scope for escape proof references

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Fri Dec 12 17:54:29 PST 2014


On 12/12/2014 4:59 PM, deadalnix wrote:
> On Saturday, 13 December 2014 at 00:52:46 UTC, Walter Bright wrote:
>> On 12/12/2014 4:07 PM, deadalnix wrote:
>>> On Saturday, 13 December 2014 at 00:06:18 UTC, Walter Bright wrote:
>>>> How not?
>>>
>>> scope a = new Stuff();
>>> scope b = a;
>>>
>>> auto rc1 = RC(a);
>>> auto rc2 = RC(b);
>>>
>>> // Enjoy the free when it comes !
>>
>> What's the type signature of RC ?
>
> RCWrapper!T RC(T)(scope T t) or somethign along these lines.

And how does RC assign it to the wrapper? (It will fail to compile, and so won't 
be a safety hole.)


More information about the Digitalmars-d mailing list