Can I move-assign a std::map's contents into another std::map?
问题 Is it possible to insert the contents of a temporary std::map temp into another std::map m by using move semantics, such that the values from the temporary are not copied and are reused? Let's say one has: std::map<int, Data> temp; std::map<int, Data> m; One way of copying values from temp into m is: m.insert(temp.begin(),temp.end()); How can I move the temp elements into m , instead of copying? 回答1: HINT: Read the update first! The current C++11 standard and the C++14 draft do not provide a