Const ref and rvalues again...
foobar
foo at bar.com
Fri Oct 19 01:54:26 PDT 2012
On Friday, 19 October 2012 at 07:53:30 UTC, Jacob Carlborg wrote:
> On 2012-10-19 04:48, Timon Gehr wrote:
>
>> Then how to specify that the value of x cannot be escaped?
>> I'm in favour of doing it the other way round and disallow
>> escaping of
>> ref parameters without an unsafe cast.
>
> "scope" is supposed to be used to prevent this.
I like Timon's idea. "scope" is a bad fit in that the default
should be the safe option. Unfortunately this does have the
potential to brake lots of code, perhaps even if we limit it to
@safe code.
An argument could be made that it's worth the breakage for @safe
code to insure better safety.
More information about the Digitalmars-d
mailing list