Am 19.08.2011, 14:50 Uhr, schrieb Timon Gehr <timon.g...@gmx.ch>:
void foo(ref S);
...
foo(S(...));

is equivalent to one explicitly declaring the temporary:

{auto __temp=S(...); foo(__temp);}

The difference is that the first is more pleasant to write. If temporaries would become rvalues everyone would always have to write the second form manually. So imho it is just a syntax sugar issue.

I'd actually argue that ref-passing should work for arbitrary function results too.

+1, but const should be required.

Reply via email to