Hi

Here is a patch to add heterogeneous lookup to alternative modes. To do so I had to expose __is_transparent as __has_is_transparent to avoid confilct with existing __is_transparent. Should I put it in __detail namespace ?

    * include/bits/stl_tree.h (_Rb_tree<>::__is_transparent<>): Move to
    outer scope and rename in ...
    (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.

Tested under linux x86_64 debug and profile modes.

François

Index: include/bits/stl_tree.h
===================================================================
--- include/bits/stl_tree.h	(revision 224099)
+++ include/bits/stl_tree.h	(working copy)
@@ -341,7 +341,17 @@
   _Rb_tree_rebalance_for_erase(_Rb_tree_node_base* const __z,
 			       _Rb_tree_node_base& __header) throw ();
 
+#if __cplusplus > 201103L
+  template<typename _Cmp, typename _Kt, typename = __void_t<>>
+    struct __has_is_transparent
+    { };
 
+  template<typename _Cmp, typename _Kt>
+    struct __has_is_transparent<_Cmp, _Kt,
+				__void_t<typename _Cmp::is_transparent>>
+    { typedef void type; };
+#endif
+
   template<typename _Key, typename _Val, typename _KeyOfValue,
            typename _Compare, typename _Alloc = allocator<_Val> >
     class _Rb_tree
@@ -1109,16 +1119,9 @@
       equal_range(const key_type& __k) const;
 
 #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,
-	       typename _Req = typename __is_transparent<_Compare, _Kt>::type>
+	       typename _Req =
+		 typename __has_is_transparent<_Compare, _Kt>::type>
 	iterator
 	_M_find_tr(const _Kt& __k)
 	{
@@ -1127,7 +1130,8 @@
 	}
 
       template<typename _Kt,
-	       typename _Req = typename __is_transparent<_Compare, _Kt>::type>
+	       typename _Req =
+		 typename __has_is_transparent<_Compare, _Kt>::type>
 	const_iterator
 	_M_find_tr(const _Kt& __k) const
 	{
@@ -1138,7 +1142,8 @@
 	}
 
       template<typename _Kt,
-	       typename _Req = typename __is_transparent<_Compare, _Kt>::type>
+	       typename _Req =
+		 typename __has_is_transparent<_Compare, _Kt>::type>
 	size_type
 	_M_count_tr(const _Kt& __k) const
 	{
@@ -1147,7 +1152,8 @@
 	}
 
       template<typename _Kt,
-	       typename _Req = typename __is_transparent<_Compare, _Kt>::type>
+	       typename _Req =
+		 typename __has_is_transparent<_Compare, _Kt>::type>
 	iterator
 	_M_lower_bound_tr(const _Kt& __k)
 	{
@@ -1156,7 +1162,8 @@
 	}
 
       template<typename _Kt,
-	       typename _Req = typename __is_transparent<_Compare, _Kt>::type>
+	       typename _Req =
+		 typename __has_is_transparent<_Compare, _Kt>::type>
 	const_iterator
 	_M_lower_bound_tr(const _Kt& __k) const
 	{
@@ -1174,7 +1181,8 @@
 	}
 
       template<typename _Kt,
-	       typename _Req = typename __is_transparent<_Compare, _Kt>::type>
+	       typename _Req =
+		 typename __has_is_transparent<_Compare, _Kt>::type>
 	iterator
 	_M_upper_bound_tr(const _Kt& __k)
 	{
@@ -1183,7 +1191,8 @@
 	}
 
       template<typename _Kt,
-	       typename _Req = typename __is_transparent<_Compare, _Kt>::type>
+	       typename _Req =
+		 typename __has_is_transparent<_Compare, _Kt>::type>
 	const_iterator
 	_M_upper_bound_tr(const _Kt& __k) const
 	{
@@ -1201,7 +1210,8 @@
 	}
 
       template<typename _Kt,
-	       typename _Req = typename __is_transparent<_Compare, _Kt>::type>
+	       typename _Req =
+		 typename __has_is_transparent<_Compare, _Kt>::type>
 	pair<iterator, iterator>
 	_M_equal_range_tr(const _Kt& __k)
 	{
@@ -1211,7 +1221,8 @@
 	}
 
       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>
 	_M_equal_range_tr(const _Kt& __k) const
 	{
Index: include/debug/map.h
===================================================================
--- include/debug/map.h	(revision 224099)
+++ include/debug/map.h	(working copy)
@@ -412,10 +412,28 @@
       find(const key_type& __x)
       { 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
       find(const key_type& __x) const
       { 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;
 
       iterator
@@ -422,18 +440,54 @@
       lower_bound(const key_type& __x)
       { 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
       lower_bound(const key_type& __x) const
       { 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
       upper_bound(const key_type& __x)
       { 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
       upper_bound(const key_type& __x) const
       { 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>
       equal_range(const key_type& __x)
       {
@@ -443,6 +497,18 @@
 			      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>
       equal_range(const key_type& __x) const
       {
@@ -452,6 +518,18 @@
 			      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&
       _M_base() _GLIBCXX_NOEXCEPT	{ return *this; }
 
Index: include/debug/multimap.h
===================================================================
--- include/debug/multimap.h	(revision 224099)
+++ include/debug/multimap.h	(working copy)
@@ -393,10 +393,28 @@
       find(const key_type& __x)
       { 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
       find(const key_type& __x) const
       { 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;
 
       iterator
@@ -403,18 +421,54 @@
       lower_bound(const key_type& __x)
       { 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
       lower_bound(const key_type& __x) const
       { 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
       upper_bound(const key_type& __x)
       { 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
       upper_bound(const key_type& __x) const
       { 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>
       equal_range(const key_type& __x)
       {
@@ -424,6 +478,18 @@
 			      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>
       equal_range(const key_type& __x) const
       {
@@ -433,6 +499,18 @@
 			      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&
       _M_base() _GLIBCXX_NOEXCEPT { return *this; }
 
Index: include/debug/multiset.h
===================================================================
--- include/debug/multiset.h	(revision 224099)
+++ include/debug/multiset.h	(working copy)
@@ -386,6 +386,22 @@
       find(const key_type& __x) const
       { 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;
 
       iterator
@@ -398,6 +414,22 @@
       lower_bound(const key_type& __x) const
       { 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
       upper_bound(const key_type& __x)
       { return iterator(_Base::upper_bound(__x), this); }
@@ -408,6 +440,22 @@
       upper_bound(const key_type& __x) const
       { 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>
       equal_range(const key_type& __x)
       {
@@ -428,6 +476,28 @@
 			      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&
       _M_base() _GLIBCXX_NOEXCEPT { return *this; }
 
Index: include/debug/set.h
===================================================================
--- include/debug/set.h	(revision 224099)
+++ include/debug/set.h	(working copy)
@@ -393,6 +393,22 @@
       find(const key_type& __x) const
       { 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;
 
       iterator
@@ -405,6 +421,22 @@
       lower_bound(const key_type& __x) const
       { 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
       upper_bound(const key_type& __x)
       { return iterator(_Base::upper_bound(__x), this); }
@@ -415,6 +447,22 @@
       upper_bound(const key_type& __x) const
       { 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>
       equal_range(const key_type& __x)
       {
@@ -429,12 +477,34 @@
       std::pair<const_iterator,const_iterator>
       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);
 	return std::make_pair(const_iterator(__res.first, 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&
       _M_base() _GLIBCXX_NOEXCEPT	{ return *this; }
 
Index: include/profile/map.h
===================================================================
--- include/profile/map.h	(revision 224099)
+++ include/profile/map.h	(working copy)
@@ -429,6 +429,18 @@
 	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
       find(const key_type& __x) const
       {
@@ -436,6 +448,18 @@
 	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
       count(const key_type& __x) const
       {
@@ -443,6 +467,18 @@
 	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
       lower_bound(const key_type& __x)
       {
@@ -451,6 +487,19 @@
 	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
       lower_bound(const key_type& __x) const
       {
@@ -459,6 +508,19 @@
 	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
       upper_bound(const key_type& __x)
       {
@@ -467,6 +529,19 @@
 	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
       upper_bound(const key_type& __x) const
       {
@@ -475,6 +550,19 @@
 	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>
       equal_range(const key_type& __x)
       {
@@ -485,6 +573,19 @@
 			      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>
       equal_range(const key_type& __x) const
       {
@@ -495,6 +596,19 @@
 			      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&
       _M_base() _GLIBCXX_NOEXCEPT	{ return *this; }
 
Index: include/profile/multimap.h
===================================================================
--- include/profile/multimap.h	(revision 224099)
+++ include/profile/multimap.h	(working copy)
@@ -388,6 +388,18 @@
 	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
       find(const key_type& __x) const
       {
@@ -395,6 +407,18 @@
 	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
       count(const key_type& __x) const
       {
@@ -402,6 +426,18 @@
 	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
       lower_bound(const key_type& __x)
       {
@@ -410,6 +446,19 @@
 	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
       lower_bound(const key_type& __x) const
       {
@@ -418,6 +467,19 @@
 	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
       upper_bound(const key_type& __x)
       {
@@ -426,6 +488,19 @@
 	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
       upper_bound(const key_type& __x) const
       {
@@ -434,6 +509,19 @@
 	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>
       equal_range(const key_type& __x)
       {
@@ -444,6 +532,19 @@
 			      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>
       equal_range(const key_type& __x) const
       {
@@ -454,6 +555,19 @@
 			      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&
       _M_base() _GLIBCXX_NOEXCEPT	{ return *this; }
 
Index: include/profile/multiset.h
===================================================================
--- include/profile/multiset.h	(revision 224099)
+++ include/profile/multiset.h	(working copy)
@@ -379,6 +379,18 @@
 	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:
       iterator
       find(const key_type& __x)
@@ -396,6 +408,28 @@
 	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
       lower_bound(const key_type& __x)
       {
@@ -413,6 +447,30 @@
 	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
       upper_bound(const key_type& __x)
       {
@@ -431,6 +489,30 @@
 	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>
       equal_range(const key_type& __x)
       {
@@ -453,6 +535,30 @@
 			      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&
       _M_base() _GLIBCXX_NOEXCEPT	{ return *this; }
 
Index: include/profile/set.h
===================================================================
--- include/profile/set.h	(revision 224099)
+++ include/profile/set.h	(working copy)
@@ -369,6 +369,18 @@
 	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:
       iterator
       find(const key_type& __x)
@@ -384,6 +396,28 @@
 	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
       lower_bound(const key_type& __x)
       {
@@ -400,6 +434,30 @@
 	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
       upper_bound(const key_type& __x)
       {
@@ -416,6 +474,30 @@
 	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>
       equal_range(const key_type& __x)
       {
@@ -436,6 +518,30 @@
 			      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&
       _M_base() _GLIBCXX_NOEXCEPT	{ return *this; }
 

Reply via email to