This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/61143] [4.9/4.10 Regression] Arithmetic exception on emplacing into unordered_map moved out
- From: "felix at fontein dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 13 May 2014 15:26:06 +0000
- Subject: [Bug libstdc++/61143] [4.9/4.10 Regression] Arithmetic exception on emplacing into unordered_map moved out
- Auto-submitted: auto-generated
- References: <bug-61143-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61143
--- Comment #9 from Felix Fontein <felix at fontein dot de> ---
Another workaround is to use reserve(), as in:
std::unordered_map<int, int> b = std::move(a);
a.reserve(1); // any number > 0 will do
a.emplace(1, 1);