On Thursday, 10 July 2014 at 18:16:57 UTC, H. S. Teoh via Digitalmars-d wrote:
There is an interesting subtlety here, in that local variables
themselves are not necessarily scoped, for example:

        class C {}
        C createObj() {
                auto obj = new C;       // obj is a local variable
return obj; // but its lifetime can be extended outside the function
        }

They are scoped, but to the lifetime of the GC, which is the length of the program. Anything that the GC owns can safely be marked scope(static) or however you would write it.

Reply via email to