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 |
|
mirek
Messages: 13975 Registered: November 2005
|
Ultimate Member |
|
|
cbpporter wrote on Thu, 18 December 2014 12:55What 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.
|
|
|
Goto Forum:
Current Time: Fri Apr 19 17:32:48 CEST 2024
Total time taken to generate the page: 0.08847 seconds
|