aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2018-09-03 15:25:12 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2018-09-03 15:25:12 +0100
commitbc62e155e412fd2230ec0538e2bef86211d26301 (patch)
treed1599d3dc442dce5d10470f835ebc341956a59ae /gcc
parenta6b75a69dae0cfaa9085708073ebd1853e0e6102 (diff)
downloadgcc-bc62e155e412fd2230ec0538e2bef86211d26301.zip
gcc-bc62e155e412fd2230ec0538e2bef86211d26301.tar.gz
gcc-bc62e155e412fd2230ec0538e2bef86211d26301.tar.bz2
PR libstdc++/78595 implement insertion into maps in terms of emplace
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
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions