map.emplace(std::piecewise_construct, std::make_tuple(0), std::make_tuple()) build the zero argument Z at location 0 .
map[0] will also do this if it does not already exist.
emplace takes arguments to build a std::pair<const K, V> . std::pair has a constructor with std::piecewise_construct_t tags that takes two tuples, the first is used to build the first argument, the second to build the second argument.
therefore std::pair<const int, Z> test( std::piecewise_construct, std::make_tuple(0), std::make_tuple() ) creates test elements in place, const int is built using (0) . Z is constructed using () .
map.emplace forwards are arguments to the std::pair constructor.
source share