56g2000hsm.googlegroups.com>, ai*******@gmail.com says...
Hi,That's not the real reason for rvalue references. There are two primary
I have been reading the improvement that will be made to C++0x, and
one of this is "A Proposal to Add an Rvalue Reference to the C++
Language" , which will add a double &, for example:
int someFunction(int && a){ ...
the reason is to allow to change temporaries passed to functions. Due
to:
reasons for rvalue references: providing move semantics, and providing
forwarding semantics.
The ability to modify the original object with impunity is the
_mechanism_ behind the move semantics. Looking at this as 'mutable',
however is looking at how you do one thing with rvalue references,
rather than looking at what the rvalue reference itself really is.
This would also completely ignore the other major use of rvalue
references, which is forwarding. In this case, the ability to modify the
original item is entirely beside the point -- it's mostly about avoiding
providing lots of overloads of forwarding functions.
--
Later,
Jerry.
The universe is a figment of its own imagination.