El 07/09/2011 17:40, Szymon Gatner escribió:
2011/9/7 Ion Gaztañaga
: El 07/09/2011 0:05, Szymon Gatner escribió:
It's moved, this feature produces the limitation (must define copy-constructor for copyable types owning copyable and movables classes like boost::container::vector) that Daniel has suffered. Example:
It is still not clear to me. What is moved and in under what conditions?
Let me clarify me question: will this move or copy:
boost::container::vector<int> makeInts() { boost::container::vector<int> ret; //.... return ret; }
boost::container::vector<int> ints;
ints = makeInts()<========= move or copy?
Depending on the compiler, move or copy (Named return value optimization is not so friendly with emulated move semantics). If you want to be really sure, use return ::boost:move(ret); Best, Ion