ref is unsafe

deadalnix deadalnix at gmail.com
Thu Jan 3 15:03:46 PST 2013


On Thursday, 3 January 2013 at 21:56:22 UTC, David Nadlinger 
wrote:
> I must admit that I haven't read the rest of the thread yet, 
> but I think the obvious and correct solution is to disallow 
> passing locals (including non-ref parameters, which are 
> effectively locals in D) as non-scope ref arguments.
>
> The scope attribute, once properly implemented, would make sure 
> that the reference is not escaped. For now, we could just make 
> it behave overly conservative in @safe code.
>

This seems to me like the sane thing to do.


More information about the Digitalmars-d mailing list