|
|
On Tue, 02 Sep 2008 23:16:45 +0200, Darren New <dne### [at] sanrrcom> wrote:
> But the rvalue thing doesn't move a value. What does the rvalue thing
> actually *do* that's different from anything else?
It lets you distinguish objects whose values will soon be discarded anyway
from objects whose values may not be tampered with.
> Isn't it that it points to a temporary with a guarantee of no aliases?
Aliasing is not the issue. Expected lifetime is.
>> Note that non-temporaries can also be bound to r-value references, but
>> not implicitly.
>
> Well, yes, because C++ lets you break anything. That's not the point,
> tho. :-)
It is useful when you need to shuffle values around, but you do not want
to pay the price of copying them.
--
FE
Post a reply to this message
|
|