This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] PR libstdc++/82522 overload map insert functions for rvalues (LWG 2354)


DR 2354 adds these overloads to avoid unnecessary copies when doing
map.insert({key, val})

	PR libstdc++/82522
	* doc/xml/manual/intro.xml: Document LWG 2354 changes.
	* include/bits/stl_map.h (map::insert(value_type&&))
	(map::insert(const_iterator, value_type&&)): Add overload for rvalues.
	* include/bits/stl_multimap.h (multimap::insert(value_type&&))
	(multimap::insert(const_iterator, value_type&&)): Likewise.
	* include/bits/unordered_map.h (unordered_map::insert(value_type&&))
	(unordered_map::insert(const_iterator, value_type&&))
	(unordered_multimap::insert(value_type&&))
	(unordered_multimap::insert(const_iterator, value_type&&)): Likewise.
	* testsuite/23_containers/map/modifiers/insert/dr2354.cc: New test.
	* testsuite/23_containers/multimap/modifiers/insert/dr2354.cc: New
	test.
	* testsuite/23_containers/unordered_map/insert/dr2354.cc: New test.
	* testsuite/23_containers/unordered_multimap/insert/dr2354.cc: New
	test.

Tested powerpc64le-linux, committed to trunk.


Attachment: patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]