Function scope arguments

deadalnix deadalnix at gmail.com
Tue Jan 15 03:48:39 PST 2013


On Tuesday, 15 January 2013 at 10:58:17 UTC, Artur Skawina wrote:
> Different problem - lifetime. One approach would be to disallow 
> escaping
> them (which in this case includes returning them) unless the 
> compiler is
> able to do the right - ie the body of the function is 
> available. Somewhat
> unorthodox, but could work. (The problem are not the trivial 
> cases; it's the
> ones where the compiler has no idea which ref is 
> escaped/returned at runtime)
>

The compiler should assume they may escape unless scope is 
specified.


More information about the Digitalmars-d mailing list