Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Coffee corner » C++11
Re: C++11 [message #38143 is a reply to message #38134] Sun, 02 December 2012 18:05 Go to previous messageGo to previous message
Lance is currently offline  Lance
Messages: 527
Registered: March 2007
Contributor
Honza, you are right. A named object has to be std:move()'ed to communicate its moveable (temporary) status to the compiler, even when it's declared as temporary (using &&). std::move will appear a lot in new library code and user code as well, so people will get use to it soon.

You can do in move assignments or move constructors the same thing you used to do in pick constructor and pick assignment, eg, mark the right hand object as picked.

Now we can do
Vector<int> b=std:move(anotherVectorIntInstance); // move construction;

//or
Vector<int> b=anotherVectorIntInstance; //copy construction or deep copy, instead of
Vector<int> b(anotherVectorIntInstance, 0); // using dummy param to signal the intention of deep copy.

provide the underlying U++ facilities are modified using the rvalue reference language feature.

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: live session Prague 8.3.2013
Next Topic: Have Visual Studio? Looking for prebuilt SDL 2.0
Goto Forum:
  


Current Time: Mon Apr 29 18:11:00 CEST 2024

Total time taken to generate the page: 0.02046 seconds