[dmd-beta] D 2.059 beta 4

Andrei Alexandrescu andrei at erdani.com
Mon Apr 9 19:43:19 PDT 2012


On 4/9/12 9:32 PM, Nick Sabalausky wrote:
> foo(MyStruct());
>
> ...shouldn't be considered any different from:
>
> auto _tmp = MyStruct();
> foo(_tmp);
>
> regardless of foo's signature. That's what I would intuitively expect.

They are different because in the latter case _tmp may or may not be 
used, whereas in the former the value is disposable.


Andrei


More information about the dmd-beta mailing list