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.

Reply via email to