The liabilities of binding rvalues to ref

Peter Alexander peter.alexander.au at gmail.com
Fri May 10 01:24:25 PDT 2013


On Friday, 10 May 2013 at 00:08:50 UTC, Manu wrote:
> As I've had to re-iterate countless times, and such is the 
> massive fallacy
> behind all of these threads, this whole debate is NOT about
> lvalues/rvalues, and I wish people would stop using the term 
> 'rvalue' in
> their posts, I worry that they misunderstand the problem every 
> time it's
> said.
>
> This code is broken:
>   void f(ref int x) {}
>   int x;
>   f(x);
>
> x is an lvalue.

There's nothing broken about that code. In what way do you 
believe it is broken?


> The problem we need to solve is that of a function being able 
> to safely
> receive a _temporary_.

temporary = rvalue



More information about the Digitalmars-d mailing list