DIP-1000 and slice lifetimes

Nordlöw via Digitalmars-d digitalmars-d at puremagic.com
Fri Dec 16 04:37:56 PST 2016


Will DIP-1000 correctly forbid code such as

     int[] xs;
     {
         int[3] x = [1, 2, 3];
         xs = x[]; // leaks dangling pointer `xs.ptr` to enclosing 
scope
     }
     xs[] = 0; // undefined behaviour

from compiling?


More information about the Digitalmars-d mailing list