POV-Ray : Newsgroups : povray.off-topic : Wikipath : Re: Wikipath Server Time
1 Oct 2024 00:07:42 EDT (-0400)
  Re: Wikipath  
From: Fredrik Eriksson
Date: 2 Sep 2008 17:26:55
Message: <op.ugvhu5xq7bxctx@e6600>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.