Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ > Re: Notation of...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 3 Topic 45814 of 47032
Post > Topic >>

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

by Jerry Coffin <jcoffin@[EMAIL PROTECTED] > May 10, 2008 at 10:54 AM

In article <9f60e411-a5b1-4571-9d3d-005432378cd4@[EMAIL PROTECTED]
>, aitorf666@[EMAIL PROTECTED]
 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 tem****aries 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.
 




 3 Posts in Topic:
Notation of "A Proposal to Add an Rvalue Reference to the C++
aitorf666@[EMAIL PROTECTE  2008-05-08 12:53:43 
Re: Notation of "A Proposal to Add an Rvalue Reference to the C
"Victor Bazarov"  2008-05-08 16:44:18 
Re: Notation of "A Proposal to Add an Rvalue Reference to the C
Jerry Coffin <jcoffin@  2008-05-10 10:54:06 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 16:02:06 CDT 2008.