This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/44436] [C++0x] Implement emplace* in associative and unordered containers
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 9 Jun 2011 12:25:18 +0000
- Subject: [Bug libstdc++/44436] [C++0x] Implement emplace* in associative and unordered containers
- Auto-submitted: auto-generated
- References: <bug-44436-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44436
--- Comment #22 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-06-09 12:25:15 UTC ---
(In reply to comment #21)
> Now with a unique_ptr I'd like to do the same:
>
>
> instancesByIds_[id] = user;
> instancesByIds_[id] = std::move(user);
>
> Both doesnt work.
Nonsense. The second one works fine.
This works too:
instancesByIds_.insert(make_pair(id, std::move(user)));