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 » How would you design a good copy/move semantics system?
Re: How would you design a good copy/move semantics system? [message #44149 is a reply to message #44049] Thu, 08 January 2015 11:23 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
cbpporter wrote on Thu, 18 December 2014 12:55
What I'm mostly interested in is what are the rules for guaranteeing a maximum invocation of move constructors in implicit situations, like when assigning or returning values.

U++ chose to have default copy to be move for this reason, right?


Originally, yes. But please note that the whole thing changed last year.

Now you have to be explicit, either 'pick' or 'clone' the source, with some exceptions (e.g. returning temporary). (Enforced in C++11, in C++0x it is backward compatible).

IMO, C++11 way, where move constructor is called "sometimes" based on context leads to using deep copy in unexpected situations.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Extracting links challenge
Next Topic: Banana PI
Goto Forum:
  


Current Time: Fri Apr 19 17:32:48 CEST 2024

Total time taken to generate the page: 0.08847 seconds