By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,275 Members | 947 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,275 IT Pros & Developers. It's quick & easy.

Re: Notation of "A Proposal to Add an Rvalue Reference to the C++ Language"

P: n/a
In article <9f60e411-a5b1-4571-9d3d-005432378cd4@
56g2000hsm.googlegroups.com>, ai*******@gmail.com says...
Hi,
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:
That's not the real reason for rvalue references. There are two primary
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.
Jun 27 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.