The rules for emplace in map, multimap, unordered_map and unordered_multimap changed a while back and I'm just now updating to these new rules. In a nutshell, you've got to know you're emplacing to a pair and use one of pair's constructors. I made one extension: If you want to emplace the key and default construct the mapped_type, you can just emplace(key), as opposed to emplace(piecewise_construct, forward_as_tuple(key), forward_as_tuple()).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@157503 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Howard Hinnant
2012-05-25 22:04:21 +00:00
parent 3e3e5ebc72
commit 635ce1d127
11 changed files with 291 additions and 264 deletions

View File

@@ -15,11 +15,15 @@
#include <map>
#if !__has_feature(cxx_noexcept)
struct X
{
std::multimap<int, X> m;
};
#endif
int main()
{
}