C++14 simplified the specification of the generic insert function templates to be equivalent to calling emplace (or emplace_hint). Defining them in terms of emplace takes care of the problems described in PR 78595, ensuring a single conversion to value_type is done at the right time. PR libstdc++/78595 * include/bits/stl_map.h (map::insert(_Pair&&)) (map::insert(const_iterator, _Pair&&)): Do emplace instead of insert. * include/bits/stl_multimap.h (multimap::insert(_Pair&&)) (multimap::insert(const_iterator, _Pair&&)): Likewise. * include/bits/unordered_map.h (unordered_map::insert(_Pair&&)) (unordered_map::insert(const_iterator, _Pair&&)) (unordered_multimap::insert(_Pair&&)) (unordered_multimap::insert(const_iterator, _Pair&&)): Likewise. * testsuite/23_containers/map/modifiers/insert/78595.cc: New test. * testsuite/23_containers/multimap/modifiers/insert/78595.cc: New test. * testsuite/23_containers/unordered_map/modifiers/78595.cc: New test. * testsuite/23_containers/unordered_multimap/modifiers/78595.cc: New test. From-SVN: r264059
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
allocator | Loading commit data... | |
cons | Loading commit data... | |
debug | Loading commit data... | |
erase | Loading commit data... | |
hash_policy | Loading commit data... | |
insert | Loading commit data... | |
modifiers | Loading commit data... | |
operations | Loading commit data... | |
operators | Loading commit data... | |
requirements | Loading commit data... | |
48101-2_neg.cc | Loading commit data... | |
48101_neg.cc | Loading commit data... | |
55043.cc | Loading commit data... | |
final_hash.cc | Loading commit data... | |
init-list.cc | Loading commit data... | |
observers.cc | Loading commit data... | |
pmr_typedefs.cc | Loading commit data... | |
pmr_typedefs_debug.cc | Loading commit data... | |
range_access.cc | Loading commit data... |