DIP53 and DIP49 (ver2) - New definitions for qualified constructors and postblits

Francesco Cattoglio francesco.cattoglio at gmail.com
Thu Dec 19 04:49:55 PST 2013


On Thursday, 19 December 2013 at 11:22:59 UTC, Maxim Fomin wrote:
> void main()
> {
>    immutable int* ptr = foo();
>    writeln(*ptr); // it is 0
>    GC.collect();
>    writeln(*ptr); // it is 1 now
> }
>
> Your proposal suffers from same issue. Although idea of unique 
> can be worthy, without escape analysis it is another hole.

Wow... that looks really unsettling.
But as far as I can tell, you are declaring an immutable pointer, 
and the pointer itself never changes. After all, this looks 
correct. Or am I missing something from the language specifics?


More information about the Digitalmars-d mailing list