When D feels unfinished: union initialization and NRVO

Mathias Lang pro.mathias.lang at gmail.com
Fri Mar 20 12:25:46 UTC 2020


On Thursday, 19 March 2020 at 18:17:45 UTC, Kagamin wrote:
>
> case Good.Baguette:
>   return (){
>     Foo f = { type_: type, f1: typeof(Foo.f1)("Hello World") };
>     return f;
>   }();

This satisfies the compiler (the frontend doesn't complain), but 
it doesn't do NRVO, it's a move, even on LDC. Still good to know.


More information about the Digitalmars-d mailing list