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:
@@ -15,11 +15,15 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#if !__has_feature(cxx_noexcept)
|
||||
|
||||
struct X
|
||||
{
|
||||
std::multimap<int, X> m;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user