gcc/libstdc++-v3/testsuite/23_containers/map
Jonathan Wakely 83a840a91f PR libstdc++/87194 fix range insertion into maps and sets
Since C++11 range insertion and construction of maps and sets from a
pair of iterators only requires that the iterator's value_type is
convertible to the container's value_type (previously it had to be the
same).

This fixes the implementation to meet that relaxed requirement, by
defining a pair of overloads that either insert or emplace, depending on
the iterator's value_type. Instead of adding yet another overload of
_M_insert_unique and _M_insert_equal, the overloads taking iterators are
renamed to _M_insert_range_unique and _M_insert_range_equal.

	PR libstdc++/87194
	* include/bits/stl_map.h
	(map::map(initializer_list<value_type>, const Compare&, const Alloc&))
	(map::map(initializer_list<value_type>, const Alloc&))
	(map::map(InputIterator, InputIterator, const Alloc&))
	(map::map(InputIterator, InputIterator))
	(map::map(InputIterator, InputIterator, const Compare&, const Alloc&))
	(map::insert(InputIterator, InputIterator)):
	Call _M_insert_range_unique instead of _M_insert_unique.
	* include/bits/stl_multimap.h
	(multimap::multimap(initializer_list<value_type>, const C&, const A&))
	(multimap::multimap(initializer_list<value_type>, const A&))
	(multimap::multimap(InputIterator, InputIterator, const A&))
	(multimap::multimap(InputIterator, InputIterator))
	(multimap::multimap(InputIterator, InputIterator, const C&, const A&))
	(multimap::insert(InputIterator, InputIterator)): Call
	_M_insert_range_equal instead of _M_insert_equal.
	* include/bits/stl_multiset.h
	(multiset::multiset(InputIterator, InputIterator))
	(multiset::multiset(InputIterator, InputIterator, const C&, const A&))
	(multiset::multiset(initializer_list<value_type>, const C&, const A&))
	(multiset::multiset(initializer_list<value_type>, const A&))
	(multiset::multiset(InputIterator, InputIterator, const A&))
	(multiset::insert(InputIterator, InputIterator)): Call
	_M_insert_range_equal instead of _M_insert_equal.
	* include/bits/stl_set.h
	(set::set(InputIterator, InputIterator))
	(set::set(InputIterator, InputIterator, const Compare&, const Alloc&))
	(set::set(initializer_list<value_type>, const Compare&, const Alloc&))
	(set::set(initializer_list<value_type>, const Alloc&))
	(set::set(InputIterator, InputIterator, const Alloc&))
	(set::insert(InputIterator, InputIterator)):
	Call _M_insert_range_unique instead of _M_insert_unique.
	* include/bits/stl_tree.h
	[__cplusplus >= 201103L] (_Rb_tree::__same_value_type): New alias
	template for SFINAE constraints.
	[__cplusplus >= 201103L] (_Rb_tree::_M_insert_range_unique): Pair of
	constrained overloads that either insert or emplace, depending on
	iterator's value_type.
	[__cplusplus >= 201103L] (_Rb_tree::_M_insert_range_equal): Likewise.
	[__cplusplus < 201103L] (_Rb_tree::_M_insert_range_unique)
	(_Rb_tree::_M_insert_range_equal): New functions replacing range
	versions of _M_insert_unique and _M_insert_equal.
	(_Rb_tree::_M_insert_unique(_InputIterator, _InputIterator))
	(_Rb_tree::_M_insert_equal(_InputIterator, _InputIterator)): Remove.
	* testsuite/23_containers/map/modifiers/insert/87194.cc: New test.
	* testsuite/23_containers/multimap/modifiers/insert/87194.cc: New test.
	* testsuite/23_containers/multiset/modifiers/insert/87194.cc: New test.
	* testsuite/23_containers/set/modifiers/insert/87194.cc: New test.

From-SVN: r264060
2018-09-03 15:25:25 +01:00
..
allocator Update copyright years. 2018-01-03 11:03:58 +01:00
capacity Update copyright years. 2018-01-03 11:03:58 +01:00
cons 2018-05-18 François Dumont <fdumont@gcc.gnu.org> 2018-05-18 20:49:49 +00:00
debug Update copyright years. 2018-01-03 11:03:58 +01:00
element_access Update copyright years. 2018-01-03 11:03:58 +01:00
modifiers PR libstdc++/87194 fix range insertion into maps and sets 2018-09-03 15:25:25 +01:00
operations P0458R2 Checking for Existence of an Element in Associative Containers 2018-07-04 19:16:26 +01:00
operators Update copyright years. 2018-01-03 11:03:58 +01:00
requirements Update copyright years. 2018-01-03 11:03:58 +01:00
14340.cc Update copyright years. 2018-01-03 11:03:58 +01:00
18604.cc Update copyright years. 2018-01-03 11:03:58 +01:00
23781_neg.cc Update copyright years. 2018-01-03 11:03:58 +01:00
48101_neg.cc Update copyright years. 2018-01-03 11:03:58 +01:00
48101-2_neg.cc Update copyright years. 2018-01-03 11:03:58 +01:00
56613.cc Update copyright years. 2018-01-03 11:03:58 +01:00
58764.cc Update copyright years. 2018-01-03 11:03:58 +01:00
59872.cc Update copyright years. 2018-01-03 11:03:58 +01:00
77334.cc Update copyright years. 2018-01-03 11:03:58 +01:00
init-list.cc Update copyright years. 2018-01-03 11:03:58 +01:00
pmr_typedefs_debug.cc Forward declare debug containers so std::pmr aliases work 2018-08-24 18:43:18 +01:00
pmr_typedefs.cc Define aliases for containers using polymorphic_allocator 2018-08-10 00:25:53 +01:00
pthread6.cc Update copyright years. 2018-01-03 11:03:58 +01:00
range_access.cc Update copyright years. 2018-01-03 11:03:58 +01:00