-
Suggestion
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
None
-
None
There is no way to insert an object that is moveable but not copiable.
Example:
std::unique_ptr<A> ptr(new A); std::unique_ptr<A> ptr2(new A); std::map<int, std::unique_ptr<A>> m; m[0] = std::move(ptr); //works m.insert(std::make_pair(1, std::move(ptr2))); //works QMap<int, std::unique_ptr<A>> m2; m2.insert(0, std::move(ptr)); //fails