When D feels unfinished: union initialization and NRVO

Kagamin spam at here.lot
Thu Mar 19 20:09:44 UTC 2020


On Thursday, 19 March 2020 at 18:46:13 UTC, H. S. Teoh wrote:
> Lifetime analysis is either going to break down or become 
> seriously convoluted, if you try to apply it here!

case Good.Baguette:
   if(true){
     Foo f = { type_: type, f1: typeof(Foo.f1)("Hello World") };
     return f;
   }

Pretty sure if statement must be a self-contained scope, but even 
it doesn't reset scope here.


More information about the Digitalmars-d mailing list