Commit d7b35f22 by François Dumont

stl_tree.h (_Rb_tree<>::__is_transparent<>): Move to outer scope and rename to ...

2015-06-07  François Dumont  <fdumont@gcc.gnu.org>

	* include/bits/stl_tree.h (_Rb_tree<>::__is_transparent<>): Move to
	outer scope and rename to ...
	(std::__hash_is_transparent<>): ... this.
	* include/debug/stl_map.h (map::find<>,
	map::lower_bound<>, map::upper_bound<>, map::equal_range<>): New
	member function templates to perform heterogeneous lookup.
	* include/debug/stl_multimap.h (multimap::find<>,
	multimap::lower_bound<>, multimap::upper_bound<>,
	multimap::equal_range<>): Likewise.
	* include/debug/stl_multiset.h (multiset::find<>,
	multiset::lower_bound<>, multiset::upper_bound<>,
	multiset::equal_range<>): Likewise.
	* include/debug/stl_set.h (set::find<>,
	set::lower_bound<>, set::upper_bound<>, set::equal_range<>): Likewise.
	* include/profile/stl_map.h (map::find<>, map::count<>,
	map::lower_bound<>, map::upper_bound<>, map::equal_range<>): Likewise.
	* include/profile/stl_multimap.h (multimap::find<>, multimap::count<>,
	multimap::lower_bound<>, multimap::upper_bound<>,
	multimap::equal_range<>): Likewise.
	* include/profile/stl_multiset.h (multiset::find<>, multiset::count<>,
	multiset::lower_bound<>, multiset::upper_bound<>,
	multiset::equal_range<>): Likewise.
	* include/profile/stl_set.h (set::find<>, set::count<>,
	set::lower_bound<>, set::upper_bound<>, set::equal_range<>): Likewise.
	* testsuite/23_containers/map/operations/1.cc: Check const variants.
	* testsuite/23_containers/multimap/operations/1.cc: Likewise.
	* testsuite/23_containers/multiset/operations/1.cc: Likewise.
	* testsuite/23_containers/set/operations/1.cc: Likewise.

From-SVN: r224200
parent 3d2c9e18
2015-06-07 François Dumont <fdumont@gcc.gnu.org>
* include/bits/stl_tree.h (_Rb_tree<>::__is_transparent<>): Move to
outer scope and rename to ...
(std::__hash_is_transparent<>): ... this.
* include/debug/stl_map.h (map::find<>,
map::lower_bound<>, map::upper_bound<>, map::equal_range<>): New
member function templates to perform heterogeneous lookup.
* include/debug/stl_multimap.h (multimap::find<>,
multimap::lower_bound<>, multimap::upper_bound<>,
multimap::equal_range<>): Likewise.
* include/debug/stl_multiset.h (multiset::find<>,
multiset::lower_bound<>, multiset::upper_bound<>,
multiset::equal_range<>): Likewise.
* include/debug/stl_set.h (set::find<>,
set::lower_bound<>, set::upper_bound<>, set::equal_range<>): Likewise.
* include/profile/stl_map.h (map::find<>, map::count<>,
map::lower_bound<>, map::upper_bound<>, map::equal_range<>): Likewise.
* include/profile/stl_multimap.h (multimap::find<>, multimap::count<>,
multimap::lower_bound<>, multimap::upper_bound<>,
multimap::equal_range<>): Likewise.
* include/profile/stl_multiset.h (multiset::find<>, multiset::count<>,
multiset::lower_bound<>, multiset::upper_bound<>,
multiset::equal_range<>): Likewise.
* include/profile/stl_set.h (set::find<>, set::count<>,
set::lower_bound<>, set::upper_bound<>, set::equal_range<>): Likewise.
* testsuite/23_containers/map/operations/1.cc: Check const variants.
* testsuite/23_containers/multimap/operations/1.cc: Likewise.
* testsuite/23_containers/multiset/operations/1.cc: Likewise.
* testsuite/23_containers/set/operations/1.cc: Likewise.
2015-06-05 Jonathan Wakely <jwakely@redhat.com> 2015-06-05 Jonathan Wakely <jwakely@redhat.com>
* doc/xml/manual/status_cxx2017.xml: Update status tables. * doc/xml/manual/status_cxx2017.xml: Update status tables.
......
...@@ -341,6 +341,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -341,6 +341,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_Rb_tree_rebalance_for_erase(_Rb_tree_node_base* const __z, _Rb_tree_rebalance_for_erase(_Rb_tree_node_base* const __z,
_Rb_tree_node_base& __header) throw (); _Rb_tree_node_base& __header) throw ();
#if __cplusplus > 201103L
template<typename _Cmp, typename _SfinaeType, typename = __void_t<>>
struct __has_is_transparent
{ };
template<typename _Cmp, typename _SfinaeType>
struct __has_is_transparent<_Cmp, _SfinaeType,
__void_t<typename _Cmp::is_transparent>>
{ typedef void type; };
#endif
template<typename _Key, typename _Val, typename _KeyOfValue, template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc = allocator<_Val> > typename _Compare, typename _Alloc = allocator<_Val> >
...@@ -1109,16 +1119,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1109,16 +1119,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
equal_range(const key_type& __k) const; equal_range(const key_type& __k) const;
#if __cplusplus > 201103L #if __cplusplus > 201103L
template<typename _Cmp, typename _Kt, typename = __void_t<>>
struct __is_transparent { };
template<typename _Cmp, typename _Kt>
struct
__is_transparent<_Cmp, _Kt, __void_t<typename _Cmp::is_transparent>>
{ typedef void type; };
template<typename _Kt, template<typename _Kt,
typename _Req = typename __is_transparent<_Compare, _Kt>::type> typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
iterator iterator
_M_find_tr(const _Kt& __k) _M_find_tr(const _Kt& __k)
{ {
...@@ -1127,7 +1130,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1127,7 +1130,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
} }
template<typename _Kt, template<typename _Kt,
typename _Req = typename __is_transparent<_Compare, _Kt>::type> typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
const_iterator const_iterator
_M_find_tr(const _Kt& __k) const _M_find_tr(const _Kt& __k) const
{ {
...@@ -1138,7 +1142,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1138,7 +1142,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
} }
template<typename _Kt, template<typename _Kt,
typename _Req = typename __is_transparent<_Compare, _Kt>::type> typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
size_type size_type
_M_count_tr(const _Kt& __k) const _M_count_tr(const _Kt& __k) const
{ {
...@@ -1147,7 +1152,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1147,7 +1152,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
} }
template<typename _Kt, template<typename _Kt,
typename _Req = typename __is_transparent<_Compare, _Kt>::type> typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
iterator iterator
_M_lower_bound_tr(const _Kt& __k) _M_lower_bound_tr(const _Kt& __k)
{ {
...@@ -1156,7 +1162,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1156,7 +1162,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
} }
template<typename _Kt, template<typename _Kt,
typename _Req = typename __is_transparent<_Compare, _Kt>::type> typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
const_iterator const_iterator
_M_lower_bound_tr(const _Kt& __k) const _M_lower_bound_tr(const _Kt& __k) const
{ {
...@@ -1174,7 +1181,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1174,7 +1181,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
} }
template<typename _Kt, template<typename _Kt,
typename _Req = typename __is_transparent<_Compare, _Kt>::type> typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
iterator iterator
_M_upper_bound_tr(const _Kt& __k) _M_upper_bound_tr(const _Kt& __k)
{ {
...@@ -1183,7 +1191,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1183,7 +1191,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
} }
template<typename _Kt, template<typename _Kt,
typename _Req = typename __is_transparent<_Compare, _Kt>::type> typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
const_iterator const_iterator
_M_upper_bound_tr(const _Kt& __k) const _M_upper_bound_tr(const _Kt& __k) const
{ {
...@@ -1201,7 +1210,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1201,7 +1210,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
} }
template<typename _Kt, template<typename _Kt,
typename _Req = typename __is_transparent<_Compare, _Kt>::type> typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
pair<iterator, iterator> pair<iterator, iterator>
_M_equal_range_tr(const _Kt& __k) _M_equal_range_tr(const _Kt& __k)
{ {
...@@ -1211,7 +1221,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1211,7 +1221,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
} }
template<typename _Kt, template<typename _Kt,
typename _Req = typename __is_transparent<_Compare, _Kt>::type> typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
pair<const_iterator, const_iterator> pair<const_iterator, const_iterator>
_M_equal_range_tr(const _Kt& __k) const _M_equal_range_tr(const _Kt& __k) const
{ {
......
...@@ -412,28 +412,82 @@ namespace __debug ...@@ -412,28 +412,82 @@ namespace __debug
find(const key_type& __x) find(const key_type& __x)
{ return iterator(_Base::find(__x), this); } { return iterator(_Base::find(__x), this); }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
iterator
find(const _Kt& __x)
{ return { _Base::find(__x), this }; }
#endif
const_iterator const_iterator
find(const key_type& __x) const find(const key_type& __x) const
{ return const_iterator(_Base::find(__x), this); } { return const_iterator(_Base::find(__x), this); }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
const_iterator
find(const _Kt& __x) const
{ return { _Base::find(__x), this }; }
#endif
using _Base::count; using _Base::count;
iterator iterator
lower_bound(const key_type& __x) lower_bound(const key_type& __x)
{ return iterator(_Base::lower_bound(__x), this); } { return iterator(_Base::lower_bound(__x), this); }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
iterator
lower_bound(const _Kt& __x)
{ return { _Base::lower_bound(__x), this }; }
#endif
const_iterator const_iterator
lower_bound(const key_type& __x) const lower_bound(const key_type& __x) const
{ return const_iterator(_Base::lower_bound(__x), this); } { return const_iterator(_Base::lower_bound(__x), this); }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
const_iterator
lower_bound(const _Kt& __x) const
{ return { _Base::lower_bound(__x), this }; }
#endif
iterator iterator
upper_bound(const key_type& __x) upper_bound(const key_type& __x)
{ return iterator(_Base::upper_bound(__x), this); } { return iterator(_Base::upper_bound(__x), this); }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
iterator
upper_bound(const _Kt& __x)
{ return { _Base::upper_bound(__x), this }; }
#endif
const_iterator const_iterator
upper_bound(const key_type& __x) const upper_bound(const key_type& __x) const
{ return const_iterator(_Base::upper_bound(__x), this); } { return const_iterator(_Base::upper_bound(__x), this); }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
const_iterator
upper_bound(const _Kt& __x) const
{ return { _Base::upper_bound(__x), this }; }
#endif
std::pair<iterator,iterator> std::pair<iterator,iterator>
equal_range(const key_type& __x) equal_range(const key_type& __x)
{ {
...@@ -443,6 +497,18 @@ namespace __debug ...@@ -443,6 +497,18 @@ namespace __debug
iterator(__res.second, this)); iterator(__res.second, this));
} }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
std::pair<iterator, iterator>
equal_range(const _Kt& __x)
{
auto __res = _Base::equal_range(__x);
return { { __res.first, this }, { __res.second, this } };
}
#endif
std::pair<const_iterator,const_iterator> std::pair<const_iterator,const_iterator>
equal_range(const key_type& __x) const equal_range(const key_type& __x) const
{ {
...@@ -452,6 +518,18 @@ namespace __debug ...@@ -452,6 +518,18 @@ namespace __debug
const_iterator(__res.second, this)); const_iterator(__res.second, this));
} }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
std::pair<const_iterator, const_iterator>
equal_range(const _Kt& __x) const
{
auto __res = _Base::equal_range(__x);
return { { __res.first, this }, { __res.second, this } };
}
#endif
_Base& _Base&
_M_base() _GLIBCXX_NOEXCEPT { return *this; } _M_base() _GLIBCXX_NOEXCEPT { return *this; }
......
...@@ -393,28 +393,82 @@ namespace __debug ...@@ -393,28 +393,82 @@ namespace __debug
find(const key_type& __x) find(const key_type& __x)
{ return iterator(_Base::find(__x), this); } { return iterator(_Base::find(__x), this); }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
iterator
find(const _Kt& __x)
{ return { _Base::find(__x), this }; }
#endif
const_iterator const_iterator
find(const key_type& __x) const find(const key_type& __x) const
{ return const_iterator(_Base::find(__x), this); } { return const_iterator(_Base::find(__x), this); }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
const_iterator
find(const _Kt& __x) const
{ return { _Base::find(__x), this }; }
#endif
using _Base::count; using _Base::count;
iterator iterator
lower_bound(const key_type& __x) lower_bound(const key_type& __x)
{ return iterator(_Base::lower_bound(__x), this); } { return iterator(_Base::lower_bound(__x), this); }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
iterator
lower_bound(const _Kt& __x)
{ return { _Base::lower_bound(__x), this }; }
#endif
const_iterator const_iterator
lower_bound(const key_type& __x) const lower_bound(const key_type& __x) const
{ return const_iterator(_Base::lower_bound(__x), this); } { return const_iterator(_Base::lower_bound(__x), this); }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
const_iterator
lower_bound(const _Kt& __x) const
{ return { _Base::lower_bound(__x), this }; }
#endif
iterator iterator
upper_bound(const key_type& __x) upper_bound(const key_type& __x)
{ return iterator(_Base::upper_bound(__x), this); } { return iterator(_Base::upper_bound(__x), this); }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
iterator
upper_bound(const _Kt& __x)
{ return { _Base::upper_bound(__x), this }; }
#endif
const_iterator const_iterator
upper_bound(const key_type& __x) const upper_bound(const key_type& __x) const
{ return const_iterator(_Base::upper_bound(__x), this); } { return const_iterator(_Base::upper_bound(__x), this); }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
const_iterator
upper_bound(const _Kt& __x) const
{ return { _Base::upper_bound(__x), this }; }
#endif
std::pair<iterator,iterator> std::pair<iterator,iterator>
equal_range(const key_type& __x) equal_range(const key_type& __x)
{ {
...@@ -424,6 +478,18 @@ namespace __debug ...@@ -424,6 +478,18 @@ namespace __debug
iterator(__res.second, this)); iterator(__res.second, this));
} }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
std::pair<iterator, iterator>
equal_range(const _Kt& __x)
{
auto __res = _Base::equal_range(__x);
return { { __res.first, this }, { __res.second, this } };
}
#endif
std::pair<const_iterator,const_iterator> std::pair<const_iterator,const_iterator>
equal_range(const key_type& __x) const equal_range(const key_type& __x) const
{ {
...@@ -433,6 +499,18 @@ namespace __debug ...@@ -433,6 +499,18 @@ namespace __debug
const_iterator(__res.second, this)); const_iterator(__res.second, this));
} }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
std::pair<const_iterator, const_iterator>
equal_range(const _Kt& __x) const
{
auto __res = _Base::equal_range(__x);
return { { __res.first, this }, { __res.second, this } };
}
#endif
_Base& _Base&
_M_base() _GLIBCXX_NOEXCEPT { return *this; } _M_base() _GLIBCXX_NOEXCEPT { return *this; }
......
...@@ -386,6 +386,22 @@ namespace __debug ...@@ -386,6 +386,22 @@ namespace __debug
find(const key_type& __x) const find(const key_type& __x) const
{ return const_iterator(_Base::find(__x), this); } { return const_iterator(_Base::find(__x), this); }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
iterator
find(const _Kt& __x)
{ return { _Base::find(__x), this }; }
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
const_iterator
find(const _Kt& __x) const
{ return { _Base::find(__x), this }; }
#endif
using _Base::count; using _Base::count;
iterator iterator
...@@ -398,6 +414,22 @@ namespace __debug ...@@ -398,6 +414,22 @@ namespace __debug
lower_bound(const key_type& __x) const lower_bound(const key_type& __x) const
{ return const_iterator(_Base::lower_bound(__x), this); } { return const_iterator(_Base::lower_bound(__x), this); }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
iterator
lower_bound(const _Kt& __x)
{ return { _Base::lower_bound(__x), this }; }
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
const_iterator
lower_bound(const _Kt& __x) const
{ return { _Base::lower_bound(__x), this }; }
#endif
iterator iterator
upper_bound(const key_type& __x) upper_bound(const key_type& __x)
{ return iterator(_Base::upper_bound(__x), this); } { return iterator(_Base::upper_bound(__x), this); }
...@@ -408,6 +440,22 @@ namespace __debug ...@@ -408,6 +440,22 @@ namespace __debug
upper_bound(const key_type& __x) const upper_bound(const key_type& __x) const
{ return const_iterator(_Base::upper_bound(__x), this); } { return const_iterator(_Base::upper_bound(__x), this); }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
iterator
upper_bound(const _Kt& __x)
{ return { _Base::upper_bound(__x), this }; }
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
const_iterator
upper_bound(const _Kt& __x) const
{ return { _Base::upper_bound(__x), this }; }
#endif
std::pair<iterator,iterator> std::pair<iterator,iterator>
equal_range(const key_type& __x) equal_range(const key_type& __x)
{ {
...@@ -428,6 +476,28 @@ namespace __debug ...@@ -428,6 +476,28 @@ namespace __debug
const_iterator(__res.second, this)); const_iterator(__res.second, this));
} }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
std::pair<iterator, iterator>
equal_range(const _Kt& __x)
{
auto __res = _Base::equal_range(__x);
return { { __res.first, this }, { __res.second, this } };
}
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
std::pair<const_iterator, const_iterator>
equal_range(const _Kt& __x) const
{
auto __res = _Base::equal_range(__x);
return { { __res.first, this }, { __res.second, this } };
}
#endif
_Base& _Base&
_M_base() _GLIBCXX_NOEXCEPT { return *this; } _M_base() _GLIBCXX_NOEXCEPT { return *this; }
......
...@@ -393,6 +393,22 @@ namespace __debug ...@@ -393,6 +393,22 @@ namespace __debug
find(const key_type& __x) const find(const key_type& __x) const
{ return const_iterator(_Base::find(__x), this); } { return const_iterator(_Base::find(__x), this); }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
iterator
find(const _Kt& __x)
{ return { _Base::find(__x), this }; }
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
const_iterator
find(const _Kt& __x) const
{ return { _Base::find(__x), this }; }
#endif
using _Base::count; using _Base::count;
iterator iterator
...@@ -405,6 +421,22 @@ namespace __debug ...@@ -405,6 +421,22 @@ namespace __debug
lower_bound(const key_type& __x) const lower_bound(const key_type& __x) const
{ return const_iterator(_Base::lower_bound(__x), this); } { return const_iterator(_Base::lower_bound(__x), this); }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
iterator
lower_bound(const _Kt& __x)
{ return { _Base::lower_bound(__x), this }; }
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
const_iterator
lower_bound(const _Kt& __x) const
{ return { _Base::lower_bound(__x), this }; }
#endif
iterator iterator
upper_bound(const key_type& __x) upper_bound(const key_type& __x)
{ return iterator(_Base::upper_bound(__x), this); } { return iterator(_Base::upper_bound(__x), this); }
...@@ -415,7 +447,23 @@ namespace __debug ...@@ -415,7 +447,23 @@ namespace __debug
upper_bound(const key_type& __x) const upper_bound(const key_type& __x) const
{ return const_iterator(_Base::upper_bound(__x), this); } { return const_iterator(_Base::upper_bound(__x), this); }
std::pair<iterator,iterator> #if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
iterator
upper_bound(const _Kt& __x)
{ return { _Base::upper_bound(__x), this }; }
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
const_iterator
upper_bound(const _Kt& __x) const
{ return { _Base::upper_bound(__x), this }; }
#endif
std::pair<iterator, iterator>
equal_range(const key_type& __x) equal_range(const key_type& __x)
{ {
std::pair<_Base_iterator, _Base_iterator> __res = std::pair<_Base_iterator, _Base_iterator> __res =
...@@ -426,15 +474,37 @@ namespace __debug ...@@ -426,15 +474,37 @@ namespace __debug
// _GLIBCXX_RESOLVE_LIB_DEFECTS // _GLIBCXX_RESOLVE_LIB_DEFECTS
// 214. set::find() missing const overload // 214. set::find() missing const overload
std::pair<const_iterator,const_iterator> std::pair<const_iterator, const_iterator>
equal_range(const key_type& __x) const equal_range(const key_type& __x) const
{ {
std::pair<_Base_iterator, _Base_iterator> __res = std::pair<_Base_const_iterator, _Base_const_iterator> __res =
_Base::equal_range(__x); _Base::equal_range(__x);
return std::make_pair(const_iterator(__res.first, this), return std::make_pair(const_iterator(__res.first, this),
const_iterator(__res.second, this)); const_iterator(__res.second, this));
} }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
std::pair<iterator, iterator>
equal_range(const _Kt& __x)
{
auto __res = _Base::equal_range(__x);
return { { __res.first, this }, { __res.second, this } };
}
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
std::pair<const_iterator, const_iterator>
equal_range(const _Kt& __x) const
{
auto __res = _Base::equal_range(__x);
return { { __res.first, this }, { __res.second, this } };
}
#endif
_Base& _Base&
_M_base() _GLIBCXX_NOEXCEPT { return *this; } _M_base() _GLIBCXX_NOEXCEPT { return *this; }
......
...@@ -429,6 +429,18 @@ namespace __profile ...@@ -429,6 +429,18 @@ namespace __profile
return iterator(_Base::find(__x), this); return iterator(_Base::find(__x), this);
} }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
iterator
find(const _Kt& __x)
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
return { _Base::find(__x), this };
}
#endif
const_iterator const_iterator
find(const key_type& __x) const find(const key_type& __x) const
{ {
...@@ -436,6 +448,18 @@ namespace __profile ...@@ -436,6 +448,18 @@ namespace __profile
return const_iterator(_Base::find(__x), this); return const_iterator(_Base::find(__x), this);
} }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
const_iterator
find(const _Kt& __x) const
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
return { _Base::find(__x), this };
}
#endif
size_type size_type
count(const key_type& __x) const count(const key_type& __x) const
{ {
...@@ -443,6 +467,18 @@ namespace __profile ...@@ -443,6 +467,18 @@ namespace __profile
return _Base::count(__x); return _Base::count(__x);
} }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
size_type
count(const _Kt& __x) const
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
return _Base::count(__x);
}
#endif
iterator iterator
lower_bound(const key_type& __x) lower_bound(const key_type& __x)
{ {
...@@ -451,6 +487,19 @@ namespace __profile ...@@ -451,6 +487,19 @@ namespace __profile
return iterator(_Base::lower_bound(__x), this); return iterator(_Base::lower_bound(__x), this);
} }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
iterator
lower_bound(const _Kt& __x)
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
__profcxx_map2umap_invalidate(this->_M_map2umap_info);
return { _Base::lower_bound(__x), this };
}
#endif
const_iterator const_iterator
lower_bound(const key_type& __x) const lower_bound(const key_type& __x) const
{ {
...@@ -459,6 +508,19 @@ namespace __profile ...@@ -459,6 +508,19 @@ namespace __profile
return const_iterator(_Base::lower_bound(__x), this); return const_iterator(_Base::lower_bound(__x), this);
} }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
const_iterator
lower_bound(const _Kt& __x) const
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
__profcxx_map2umap_invalidate(this->_M_map2umap_info);
return { _Base::lower_bound(__x), this };
}
#endif
iterator iterator
upper_bound(const key_type& __x) upper_bound(const key_type& __x)
{ {
...@@ -467,6 +529,19 @@ namespace __profile ...@@ -467,6 +529,19 @@ namespace __profile
return iterator(_Base::upper_bound(__x), this); return iterator(_Base::upper_bound(__x), this);
} }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
iterator
upper_bound(const _Kt& __x)
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
__profcxx_map2umap_invalidate(this->_M_map2umap_info);
return { _Base::upper_bound(__x), this };
}
#endif
const_iterator const_iterator
upper_bound(const key_type& __x) const upper_bound(const key_type& __x) const
{ {
...@@ -475,6 +550,19 @@ namespace __profile ...@@ -475,6 +550,19 @@ namespace __profile
return const_iterator(_Base::upper_bound(__x), this); return const_iterator(_Base::upper_bound(__x), this);
} }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
const_iterator
upper_bound(const _Kt& __x) const
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
__profcxx_map2umap_invalidate(this->_M_map2umap_info);
return { _Base::upper_bound(__x), this };
}
#endif
std::pair<iterator,iterator> std::pair<iterator,iterator>
equal_range(const key_type& __x) equal_range(const key_type& __x)
{ {
...@@ -485,6 +573,19 @@ namespace __profile ...@@ -485,6 +573,19 @@ namespace __profile
iterator(__base_ret.second, this)); iterator(__base_ret.second, this));
} }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
std::pair<iterator, iterator>
equal_range(const _Kt& __x)
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
auto __res = _Base::equal_range(__x);
return { { __res.first, this }, { __res.second, this } };
}
#endif
std::pair<const_iterator,const_iterator> std::pair<const_iterator,const_iterator>
equal_range(const key_type& __x) const equal_range(const key_type& __x) const
{ {
...@@ -495,6 +596,19 @@ namespace __profile ...@@ -495,6 +596,19 @@ namespace __profile
const_iterator(__base_ret.second, this)); const_iterator(__base_ret.second, this));
} }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
std::pair<const_iterator, const_iterator>
equal_range(const _Kt& __x) const
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
auto __res = _Base::equal_range(__x);
return { { __res.first, this }, { __res.second, this } };
}
#endif
_Base& _Base&
_M_base() _GLIBCXX_NOEXCEPT { return *this; } _M_base() _GLIBCXX_NOEXCEPT { return *this; }
......
...@@ -388,6 +388,18 @@ namespace __profile ...@@ -388,6 +388,18 @@ namespace __profile
return iterator(_Base::find(__x), this); return iterator(_Base::find(__x), this);
} }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
iterator
find(const _Kt& __x)
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
return { _Base::find(__x), this };
}
#endif
const_iterator const_iterator
find(const key_type& __x) const find(const key_type& __x) const
{ {
...@@ -395,6 +407,18 @@ namespace __profile ...@@ -395,6 +407,18 @@ namespace __profile
return const_iterator(_Base::find(__x), this); return const_iterator(_Base::find(__x), this);
} }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
const_iterator
find(const _Kt& __x) const
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
return { _Base::find(__x), this };
}
#endif
size_type size_type
count(const key_type& __x) const count(const key_type& __x) const
{ {
...@@ -402,6 +426,18 @@ namespace __profile ...@@ -402,6 +426,18 @@ namespace __profile
return _Base::count(__x); return _Base::count(__x);
} }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
size_type
count(const _Kt& __x) const
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
return _Base::count(__x);
}
#endif
iterator iterator
lower_bound(const key_type& __x) lower_bound(const key_type& __x)
{ {
...@@ -410,6 +446,19 @@ namespace __profile ...@@ -410,6 +446,19 @@ namespace __profile
return iterator(_Base::lower_bound(__x), this); return iterator(_Base::lower_bound(__x), this);
} }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
iterator
lower_bound(const _Kt& __x)
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
__profcxx_map2umap_invalidate(this->_M_map2umap_info);
return { _Base::lower_bound(__x), this };
}
#endif
const_iterator const_iterator
lower_bound(const key_type& __x) const lower_bound(const key_type& __x) const
{ {
...@@ -418,6 +467,19 @@ namespace __profile ...@@ -418,6 +467,19 @@ namespace __profile
return const_iterator(_Base::lower_bound(__x), this); return const_iterator(_Base::lower_bound(__x), this);
} }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
const_iterator
lower_bound(const _Kt& __x) const
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
__profcxx_map2umap_invalidate(this->_M_map2umap_info);
return { _Base::lower_bound(__x), this };
}
#endif
iterator iterator
upper_bound(const key_type& __x) upper_bound(const key_type& __x)
{ {
...@@ -426,6 +488,19 @@ namespace __profile ...@@ -426,6 +488,19 @@ namespace __profile
return iterator(_Base::upper_bound(__x), this); return iterator(_Base::upper_bound(__x), this);
} }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
iterator
upper_bound(const _Kt& __x)
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
__profcxx_map2umap_invalidate(this->_M_map2umap_info);
return { _Base::upper_bound(__x), this };
}
#endif
const_iterator const_iterator
upper_bound(const key_type& __x) const upper_bound(const key_type& __x) const
{ {
...@@ -434,6 +509,19 @@ namespace __profile ...@@ -434,6 +509,19 @@ namespace __profile
return const_iterator(_Base::upper_bound(__x), this); return const_iterator(_Base::upper_bound(__x), this);
} }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
const_iterator
upper_bound(const _Kt& __x) const
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
__profcxx_map2umap_invalidate(this->_M_map2umap_info);
return { _Base::upper_bound(__x), this };
}
#endif
std::pair<iterator,iterator> std::pair<iterator,iterator>
equal_range(const key_type& __x) equal_range(const key_type& __x)
{ {
...@@ -444,6 +532,19 @@ namespace __profile ...@@ -444,6 +532,19 @@ namespace __profile
iterator(__base_ret.second, this)); iterator(__base_ret.second, this));
} }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
std::pair<iterator, iterator>
equal_range(const _Kt& __x)
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
auto __res = _Base::equal_range(__x);
return { { __res.first, this }, { __res.second, this } };
}
#endif
std::pair<const_iterator,const_iterator> std::pair<const_iterator,const_iterator>
equal_range(const key_type& __x) const equal_range(const key_type& __x) const
{ {
...@@ -454,6 +555,19 @@ namespace __profile ...@@ -454,6 +555,19 @@ namespace __profile
const_iterator(__base_ret.second, this)); const_iterator(__base_ret.second, this));
} }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
std::pair<const_iterator, const_iterator>
equal_range(const _Kt& __x) const
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
auto __res = _Base::equal_range(__x);
return { { __res.first, this }, { __res.second, this } };
}
#endif
_Base& _Base&
_M_base() _GLIBCXX_NOEXCEPT { return *this; } _M_base() _GLIBCXX_NOEXCEPT { return *this; }
......
...@@ -379,6 +379,18 @@ namespace __profile ...@@ -379,6 +379,18 @@ namespace __profile
return _Base::count(__x); return _Base::count(__x);
} }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
size_type
count(const _Kt& __x) const
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
return _Base::count(__x);
}
#endif
// multiset operations: // multiset operations:
iterator iterator
find(const key_type& __x) find(const key_type& __x)
...@@ -396,6 +408,28 @@ namespace __profile ...@@ -396,6 +408,28 @@ namespace __profile
return const_iterator(_Base::find(__x), this); return const_iterator(_Base::find(__x), this);
} }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
iterator
find(const _Kt& __x)
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
return { _Base::find(__x), this };
}
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
const_iterator
find(const _Kt& __x) const
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
return { _Base::find(__x), this };
}
#endif
iterator iterator
lower_bound(const key_type& __x) lower_bound(const key_type& __x)
{ {
...@@ -413,6 +447,30 @@ namespace __profile ...@@ -413,6 +447,30 @@ namespace __profile
return const_iterator(_Base::lower_bound(__x), this); return const_iterator(_Base::lower_bound(__x), this);
} }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
iterator
lower_bound(const _Kt& __x)
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
__profcxx_map2umap_invalidate(this->_M_map2umap_info);
return { _Base::lower_bound(__x), this };
}
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
const_iterator
lower_bound(const _Kt& __x) const
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
__profcxx_map2umap_invalidate(this->_M_map2umap_info);
return { _Base::lower_bound(__x), this };
}
#endif
iterator iterator
upper_bound(const key_type& __x) upper_bound(const key_type& __x)
{ {
...@@ -431,6 +489,30 @@ namespace __profile ...@@ -431,6 +489,30 @@ namespace __profile
return const_iterator(_Base::upper_bound(__x), this); return const_iterator(_Base::upper_bound(__x), this);
} }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
iterator
upper_bound(const _Kt& __x)
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
__profcxx_map2umap_invalidate(this->_M_map2umap_info);
return { _Base::upper_bound(__x), this };
}
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
const_iterator
upper_bound(const _Kt& __x) const
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
__profcxx_map2umap_invalidate(this->_M_map2umap_info);
return { _Base::upper_bound(__x), this };
}
#endif
std::pair<iterator,iterator> std::pair<iterator,iterator>
equal_range(const key_type& __x) equal_range(const key_type& __x)
{ {
...@@ -453,6 +535,30 @@ namespace __profile ...@@ -453,6 +535,30 @@ namespace __profile
const_iterator(__base_ret.second, this)); const_iterator(__base_ret.second, this));
} }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
std::pair<iterator, iterator>
equal_range(const _Kt& __x)
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
auto __res = _Base::equal_range(__x);
return { { __res.first, this }, { __res.second, this } };
}
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
std::pair<const_iterator, const_iterator>
equal_range(const _Kt& __x) const
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
auto __res = _Base::equal_range(__x);
return { { __res.first, this }, { __res.second, this } };
}
#endif
_Base& _Base&
_M_base() _GLIBCXX_NOEXCEPT { return *this; } _M_base() _GLIBCXX_NOEXCEPT { return *this; }
......
...@@ -369,6 +369,18 @@ namespace __profile ...@@ -369,6 +369,18 @@ namespace __profile
return _Base::count(__x); return _Base::count(__x);
} }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
size_type
count(const _Kt& __x) const
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
return _Base::count(__x);
}
#endif
// set operations: // set operations:
iterator iterator
find(const key_type& __x) find(const key_type& __x)
...@@ -384,6 +396,28 @@ namespace __profile ...@@ -384,6 +396,28 @@ namespace __profile
return const_iterator(_Base::find(__x), this); return const_iterator(_Base::find(__x), this);
} }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
iterator
find(const _Kt& __x)
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
return { _Base::find(__x), this };
}
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
const_iterator
find(const _Kt& __x) const
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
return { _Base::find(__x), this };
}
#endif
iterator iterator
lower_bound(const key_type& __x) lower_bound(const key_type& __x)
{ {
...@@ -400,6 +434,30 @@ namespace __profile ...@@ -400,6 +434,30 @@ namespace __profile
return const_iterator(_Base::lower_bound(__x), this); return const_iterator(_Base::lower_bound(__x), this);
} }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
iterator
lower_bound(const _Kt& __x)
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
__profcxx_map2umap_invalidate(this->_M_map2umap_info);
return { _Base::lower_bound(__x), this };
}
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
const_iterator
lower_bound(const _Kt& __x) const
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
__profcxx_map2umap_invalidate(this->_M_map2umap_info);
return { _Base::lower_bound(__x), this };
}
#endif
iterator iterator
upper_bound(const key_type& __x) upper_bound(const key_type& __x)
{ {
...@@ -416,6 +474,30 @@ namespace __profile ...@@ -416,6 +474,30 @@ namespace __profile
return const_iterator(_Base::upper_bound(__x), this); return const_iterator(_Base::upper_bound(__x), this);
} }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
iterator
upper_bound(const _Kt& __x)
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
__profcxx_map2umap_invalidate(this->_M_map2umap_info);
return { _Base::upper_bound(__x), this };
}
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
const_iterator
upper_bound(const _Kt& __x) const
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
__profcxx_map2umap_invalidate(this->_M_map2umap_info);
return { _Base::upper_bound(__x), this };
}
#endif
std::pair<iterator, iterator> std::pair<iterator, iterator>
equal_range(const key_type& __x) equal_range(const key_type& __x)
{ {
...@@ -436,6 +518,30 @@ namespace __profile ...@@ -436,6 +518,30 @@ namespace __profile
const_iterator(__base_ret.second, this)); const_iterator(__base_ret.second, this));
} }
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
std::pair<iterator, iterator>
equal_range(const _Kt& __x)
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
auto __res = _Base::equal_range(__x);
return { { __res.first, this }, { __res.second, this } };
}
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
std::pair<const_iterator, const_iterator>
equal_range(const _Kt& __x) const
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
auto __res = _Base::equal_range(__x);
return { { __res.first, this }, { __res.second, this } };
}
#endif
_Base& _Base&
_M_base() _GLIBCXX_NOEXCEPT { return *this; } _M_base() _GLIBCXX_NOEXCEPT { return *this; }
......
...@@ -29,6 +29,7 @@ void test01() ...@@ -29,6 +29,7 @@ void test01()
map<int, int> m0; map<int, int> m0;
typedef map<int, int>::iterator iterator; typedef map<int, int>::iterator iterator;
typedef map<int, int>::const_iterator const_iterator;
typedef pair<iterator, bool> insert_return_type; typedef pair<iterator, bool> insert_return_type;
pair<iterator, iterator> pp0; pair<iterator, iterator> pp0;
typedef map<int, int>::value_type value_type; typedef map<int, int>::value_type value_type;
...@@ -110,13 +111,14 @@ void test01() ...@@ -110,13 +111,14 @@ void test01()
VERIFY( pp0.first == m0.begin() ); VERIFY( pp0.first == m0.begin() );
VERIFY( pp0.second == irt0.first ); VERIFY( pp0.second == irt0.first );
pp0 = m0.equal_range(1); const map<int, int>& m1 = m0;
VERIFY( m0.count(1) == 1 ); pair<const_iterator, const_iterator> pp1 = m1.equal_range(1);
VERIFY( *pp0.first == value_type(1, 1) ); VERIFY( m1.count(1) == 1 );
VERIFY( *pp0.second == value_type(2, 2) ); VERIFY( *pp1.first == value_type(1, 1) );
VERIFY( pp0.first == irt0.first ); VERIFY( *pp1.second == value_type(2, 2) );
VERIFY( --pp0.first == irt7.first); VERIFY( pp1.first == irt0.first );
VERIFY( pp0.second == irt1.first ); VERIFY( --pp1.first == irt7.first);
VERIFY( pp1.second == irt1.first );
} }
int int
......
...@@ -29,6 +29,7 @@ void test01() ...@@ -29,6 +29,7 @@ void test01()
multimap<int, int> mm0; multimap<int, int> mm0;
typedef multimap<int, int>::iterator iterator; typedef multimap<int, int>::iterator iterator;
typedef multimap<int, int>::const_iterator const_iterator;
pair<iterator, iterator> pp0; pair<iterator, iterator> pp0;
typedef multimap<int, int>::value_type value_type; typedef multimap<int, int>::value_type value_type;
...@@ -109,13 +110,14 @@ void test01() ...@@ -109,13 +110,14 @@ void test01()
VERIFY( pp0.first == mm0.begin() ); VERIFY( pp0.first == mm0.begin() );
VERIFY( pp0.second == iter0 ); VERIFY( pp0.second == iter0 );
pp0 = mm0.equal_range(1); const multimap<int, int>& mm1 = mm0;
VERIFY( mm0.count(1) == 5 ); pair<const_iterator, const_iterator> pp1 = mm1.equal_range(1);
VERIFY( *pp0.first == value_type(1, 1) ); VERIFY( mm1.count(1) == 5 );
VERIFY( *pp0.second == value_type(2, 2) ); VERIFY( *pp1.first == value_type(1, 1) );
VERIFY( pp0.first == iter0 ); VERIFY( *pp1.second == value_type(2, 2) );
VERIFY( --pp0.first == iter7 ); VERIFY( pp1.first == iter0 );
VERIFY( pp0.second == iter1 ); VERIFY( --pp1.first == iter7 );
VERIFY( pp1.second == iter1 );
} }
int int
......
...@@ -29,6 +29,7 @@ void test01() ...@@ -29,6 +29,7 @@ void test01()
multiset<int> ms0; multiset<int> ms0;
typedef multiset<int>::iterator iterator; typedef multiset<int>::iterator iterator;
typedef multiset<int>::const_iterator const_iterator;
pair<iterator, iterator> pp0; pair<iterator, iterator> pp0;
pp0 = ms0.equal_range(1); pp0 = ms0.equal_range(1);
...@@ -108,13 +109,14 @@ void test01() ...@@ -108,13 +109,14 @@ void test01()
VERIFY( pp0.first == ms0.begin() ); VERIFY( pp0.first == ms0.begin() );
VERIFY( pp0.second == iter0 ); VERIFY( pp0.second == iter0 );
pp0 = ms0.equal_range(1); const multiset<int>& ms1 = ms0;
VERIFY( ms0.count(1) == 5 ); pair<const_iterator, const_iterator> pp1 = ms1.equal_range(1);
VERIFY( *pp0.first == 1 ); VERIFY( ms1.count(1) == 5 );
VERIFY( *pp0.second == 2 ); VERIFY( *pp1.first == 1 );
VERIFY( pp0.first == iter0 ); VERIFY( *pp1.second == 2 );
VERIFY( --pp0.first == iter7 ); VERIFY( pp1.first == iter0 );
VERIFY( pp0.second == iter1 ); VERIFY( --pp1.first == iter7 );
VERIFY( pp1.second == iter1 );
} }
int int
......
...@@ -29,6 +29,7 @@ void test01() ...@@ -29,6 +29,7 @@ void test01()
set<int> s0; set<int> s0;
typedef set<int>::iterator iterator; typedef set<int>::iterator iterator;
typedef set<int>::const_iterator const_iterator;
typedef pair<iterator, bool> insert_return_type; typedef pair<iterator, bool> insert_return_type;
pair<iterator, iterator> pp0; pair<iterator, iterator> pp0;
...@@ -109,13 +110,14 @@ void test01() ...@@ -109,13 +110,14 @@ void test01()
VERIFY( pp0.first == s0.begin() ); VERIFY( pp0.first == s0.begin() );
VERIFY( pp0.second == irt0.first ); VERIFY( pp0.second == irt0.first );
pp0 = s0.equal_range(1); const set<int>& s1 = s0;
VERIFY( s0.count(1) == 1 ); pair<const_iterator, const_iterator> pp1 = s1.equal_range(1);
VERIFY( *pp0.first == 1 ); VERIFY( s1.count(1) == 1 );
VERIFY( *pp0.second == 2 ); VERIFY( *pp1.first == 1 );
VERIFY( pp0.first == irt0.first ); VERIFY( *pp1.second == 2 );
VERIFY( --pp0.first == irt7.first ); VERIFY( pp1.first == irt0.first );
VERIFY( pp0.second == irt1.first ); VERIFY( --pp1.first == irt7.first );
VERIFY( pp1.second == irt1.first );
} }
int int
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment