Fix bug 20740 - std::set/std::map don't support heterogeneous lookup for count(). Thanks to Jim Porter for the bug report
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216353 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
16
include/map
16
include/map
@@ -159,7 +159,7 @@ public:
|
||||
template<typename K>
|
||||
const_iterator find(const K& x) const; // C++14
|
||||
template<typename K>
|
||||
size_type count(const K& x) const;
|
||||
size_type count(const K& x) const; // C++14
|
||||
|
||||
size_type count(const key_type& k) const;
|
||||
iterator lower_bound(const key_type& k);
|
||||
@@ -353,7 +353,7 @@ public:
|
||||
template<typename K>
|
||||
const_iterator find(const K& x) const; // C++14
|
||||
template<typename K>
|
||||
size_type count(const K& x) const;
|
||||
size_type count(const K& x) const; // C++14
|
||||
|
||||
size_type count(const key_type& k) const;
|
||||
iterator lower_bound(const key_type& k);
|
||||
@@ -1104,6 +1104,12 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type count(const key_type& __k) const
|
||||
{return __tree_.__count_unique(__k);}
|
||||
#if _LIBCPP_STD_VER > 11
|
||||
template <typename _K2>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<__is_transparent<_Compare, _K2>::value,size_type>::type
|
||||
count(const _K2& __k) {return __tree_.__count_unique(__k);}
|
||||
#endif
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator lower_bound(const key_type& __k)
|
||||
{return __tree_.lower_bound(__k);}
|
||||
@@ -1834,6 +1840,12 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type count(const key_type& __k) const
|
||||
{return __tree_.__count_multi(__k);}
|
||||
#if _LIBCPP_STD_VER > 11
|
||||
template <typename _K2>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<__is_transparent<_Compare, _K2>::value,size_type>::type
|
||||
count(const _K2& __k) {return __tree_.__count_multi(__k);}
|
||||
#endif
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator lower_bound(const key_type& __k)
|
||||
{return __tree_.lower_bound(__k);}
|
||||
|
Reference in New Issue
Block a user