summaryrefslogtreecommitdiffstats
path: root/libcxx/include/set
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/include/set')
-rw-r--r--libcxx/include/set19
1 files changed, 16 insertions, 3 deletions
diff --git a/libcxx/include/set b/libcxx/include/set
index 79e8f29f0b9..70ab4d37add 100644
--- a/libcxx/include/set
+++ b/libcxx/include/set
@@ -155,9 +155,9 @@ public:
template<typename K>
const_iterator find(const K& x) const; // C++14
template<typename K>
- size_type count(const K& x) const; // C++14
-
+ size_type count(const K& x) const; // C++14
size_type count(const key_type& k) const;
+ bool contains(const key_type& x) const; // C++20
iterator lower_bound(const key_type& k);
const_iterator lower_bound(const key_type& k) const;
template<typename K>
@@ -354,8 +354,10 @@ public:
iterator find(const K& x);
template<typename K>
const_iterator find(const K& x) const; // C++14
-
+ template<typename K>
+ size_type count(const K& x) const; // C++14
size_type count(const key_type& k) const;
+ bool contains(const key_type& x) const; // C++20
iterator lower_bound(const key_type& k);
const_iterator lower_bound(const key_type& k) const;
template<typename K>
@@ -787,6 +789,12 @@ public:
typename enable_if<__is_transparent<_Compare, _K2>::value,size_type>::type
count(const _K2& __k) const {return __tree_.__count_multi(__k);}
#endif
+
+#if _LIBCPP_STD_VER > 17
+ _LIBCPP_INLINE_VISIBILITY
+ bool contains(const key_type& __k) const {return find(__k) != end();}
+#endif // _LIBCPP_STD_VER > 17
+
_LIBCPP_INLINE_VISIBILITY
iterator lower_bound(const key_type& __k)
{return __tree_.lower_bound(__k);}
@@ -1307,6 +1315,11 @@ public:
count(const _K2& __k) const {return __tree_.__count_multi(__k);}
#endif
+#if _LIBCPP_STD_VER > 17
+ _LIBCPP_INLINE_VISIBILITY
+ bool contains(const key_type& __k) const {return find(__k) != end();}
+#endif // _LIBCPP_STD_VER > 17
+
_LIBCPP_INLINE_VISIBILITY
iterator lower_bound(const key_type& __k)
{return __tree_.lower_bound(__k);}
OpenPOWER on IntegriCloud