aboutsummaryrefslogtreecommitdiff
path: root/system/include/libcxx/set
diff options
context:
space:
mode:
Diffstat (limited to 'system/include/libcxx/set')
-rw-r--r--system/include/libcxx/set168
1 files changed, 166 insertions, 2 deletions
diff --git a/system/include/libcxx/set b/system/include/libcxx/set
index 11ea9658..a537c5fe 100644
--- a/system/include/libcxx/set
+++ b/system/include/libcxx/set
@@ -66,6 +66,11 @@ public:
set(initializer_list<value_type> il, const value_compare& comp = value_compare());
set(initializer_list<value_type> il, const value_compare& comp,
const allocator_type& a);
+ template <class InputIterator>
+ set(InputIterator first, InputIterator last, const allocator_type& a)
+ : set(first, last, Compare(), a) {} // C++14
+ set(initializer_list<value_type> il, const allocator_type& a)
+ : set(il, Compare(), a) {} // C++14
~set();
set& operator=(const set& s);
@@ -129,13 +134,33 @@ public:
// set operations:
iterator find(const key_type& k);
const_iterator find(const key_type& k) const;
+ template<typename K>
+ 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;
iterator lower_bound(const key_type& k);
const_iterator lower_bound(const key_type& k) const;
+ template<typename K>
+ iterator lower_bound(const K& x); // C++14
+ template<typename K>
+ const_iterator lower_bound(const K& x) const; // C++14
+
iterator upper_bound(const key_type& k);
const_iterator upper_bound(const key_type& k) const;
+ template<typename K>
+ iterator upper_bound(const K& x); // C++14
+ template<typename K>
+ const_iterator upper_bound(const K& x) const; // C++14
pair<iterator,iterator> equal_range(const key_type& k);
pair<const_iterator,const_iterator> equal_range(const key_type& k) const;
+ template<typename K>
+ pair<iterator,iterator> equal_range(const K& x); // C++14
+ template<typename K>
+ pair<const_iterator,const_iterator> equal_range(const K& x) const; // C++14
};
template <class Key, class Compare, class Allocator>
@@ -222,6 +247,11 @@ public:
multiset(initializer_list<value_type> il, const value_compare& comp = value_compare());
multiset(initializer_list<value_type> il, const value_compare& comp,
const allocator_type& a);
+ template <class InputIterator>
+ multiset(InputIterator first, InputIterator last, const allocator_type& a)
+ : set(first, last, Compare(), a) {} // C++14
+ multiset(initializer_list<value_type> il, const allocator_type& a)
+ : set(il, Compare(), a) {} // C++14
~multiset();
multiset& operator=(const multiset& s);
@@ -285,13 +315,32 @@ public:
// set operations:
iterator find(const key_type& k);
const_iterator find(const key_type& k) const;
+ template<typename K>
+ iterator find(const K& x);
+ template<typename K>
+ const_iterator find(const K& x) const; // C++14
+
size_type count(const key_type& k) const;
iterator lower_bound(const key_type& k);
const_iterator lower_bound(const key_type& k) const;
+ template<typename K>
+ iterator lower_bound(const K& x); // C++14
+ template<typename K>
+ const_iterator lower_bound(const K& x) const; // C++14
+
iterator upper_bound(const key_type& k);
const_iterator upper_bound(const key_type& k) const;
+ template<typename K>
+ iterator upper_bound(const K& x); // C++14
+ template<typename K>
+ const_iterator upper_bound(const K& x) const; // C++14
+
pair<iterator,iterator> equal_range(const key_type& k);
pair<const_iterator,const_iterator> equal_range(const key_type& k) const;
+ template<typename K>
+ pair<iterator,iterator> equal_range(const K& x); // C++14
+ template<typename K>
+ pair<const_iterator,const_iterator> equal_range(const K& x) const; // C++14
};
template <class Key, class Compare, class Allocator>
@@ -346,7 +395,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Key, class _Compare = less<_Key>,
class _Allocator = allocator<_Key> >
-class _LIBCPP_TYPE_VIS set
+class _LIBCPP_TYPE_VIS_ONLY set
{
public:
// types:
@@ -403,6 +452,13 @@ public:
insert(__f, __l);
}
+#if _LIBCPP_STD_VER > 11
+ template <class _InputIterator>
+ _LIBCPP_INLINE_VISIBILITY
+ set(_InputIterator __f, _InputIterator __l, const allocator_type& __a)
+ : set(__f, __l, key_compare(), __a) {}
+#endif
+
_LIBCPP_INLINE_VISIBILITY
set(const set& __s)
: __tree_(__s.__tree_)
@@ -455,6 +511,12 @@ public:
insert(__il.begin(), __il.end());
}
+#if _LIBCPP_STD_VER > 11
+ _LIBCPP_INLINE_VISIBILITY
+ set(initializer_list<value_type> __il, const allocator_type& __a)
+ : set(__il, key_compare(), __a) {}
+#endif
+
_LIBCPP_INLINE_VISIBILITY
set& operator=(initializer_list<value_type> __il)
{
@@ -579,6 +641,17 @@ public:
iterator find(const key_type& __k) {return __tree_.find(__k);}
_LIBCPP_INLINE_VISIBILITY
const_iterator find(const key_type& __k) const {return __tree_.find(__k);}
+#if _LIBCPP_STD_VER > 11
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
+ find(const _K2& __k) {return __tree_.find(__k);}
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename enable_if<__is_transparent<_Compare, _K2>::value,const_iterator>::type
+ find(const _K2& __k) const {return __tree_.find(__k);}
+#endif
+
_LIBCPP_INLINE_VISIBILITY
size_type count(const key_type& __k) const
{return __tree_.__count_unique(__k);}
@@ -588,18 +661,51 @@ public:
_LIBCPP_INLINE_VISIBILITY
const_iterator lower_bound(const key_type& __k) const
{return __tree_.lower_bound(__k);}
+#if _LIBCPP_STD_VER > 11
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
+ lower_bound(const _K2& __k) {return __tree_.lower_bound(__k);}
+
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename enable_if<__is_transparent<_Compare, _K2>::value,const_iterator>::type
+ lower_bound(const _K2& __k) const {return __tree_.lower_bound(__k);}
+#endif
+
_LIBCPP_INLINE_VISIBILITY
iterator upper_bound(const key_type& __k)
{return __tree_.upper_bound(__k);}
_LIBCPP_INLINE_VISIBILITY
const_iterator upper_bound(const key_type& __k) const
{return __tree_.upper_bound(__k);}
+#if _LIBCPP_STD_VER > 11
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
+ upper_bound(const _K2& __k) {return __tree_.upper_bound(__k);}
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename enable_if<__is_transparent<_Compare, _K2>::value,const_iterator>::type
+ upper_bound(const _K2& __k) const {return __tree_.upper_bound(__k);}
+#endif
+
_LIBCPP_INLINE_VISIBILITY
pair<iterator,iterator> equal_range(const key_type& __k)
{return __tree_.__equal_range_unique(__k);}
_LIBCPP_INLINE_VISIBILITY
pair<const_iterator,const_iterator> equal_range(const key_type& __k) const
{return __tree_.__equal_range_unique(__k);}
+#if _LIBCPP_STD_VER > 11
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename enable_if<__is_transparent<_Compare, _K2>::value,pair<iterator,iterator>>::type
+ equal_range(const _K2& __k) {return __tree_.__equal_range_unique(__k);}
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename enable_if<__is_transparent<_Compare, _K2>::value,pair<const_iterator,const_iterator>>::type
+ equal_range(const _K2& __k) const {return __tree_.__equal_range_unique(__k);}
+#endif
};
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -685,7 +791,7 @@ swap(set<_Key, _Compare, _Allocator>& __x,
template <class _Key, class _Compare = less<_Key>,
class _Allocator = allocator<_Key> >
-class _LIBCPP_TYPE_VIS multiset
+class _LIBCPP_TYPE_VIS_ONLY multiset
{
public:
// types:
@@ -734,6 +840,13 @@ public:
insert(__f, __l);
}
+#if _LIBCPP_STD_VER > 11
+ template <class _InputIterator>
+ _LIBCPP_INLINE_VISIBILITY
+ multiset(_InputIterator __f, _InputIterator __l, const allocator_type& __a)
+ : multiset(__f, __l, key_compare(), __a) {}
+#endif
+
template <class _InputIterator>
_LIBCPP_INLINE_VISIBILITY
multiset(_InputIterator __f, _InputIterator __l,
@@ -793,6 +906,12 @@ public:
insert(__il.begin(), __il.end());
}
+#if _LIBCPP_STD_VER > 11
+ _LIBCPP_INLINE_VISIBILITY
+ multiset(initializer_list<value_type> __il, const allocator_type& __a)
+ : multiset(__il, key_compare(), __a) {}
+#endif
+
_LIBCPP_INLINE_VISIBILITY
multiset& operator=(initializer_list<value_type> __il)
{
@@ -917,27 +1036,72 @@ public:
iterator find(const key_type& __k) {return __tree_.find(__k);}
_LIBCPP_INLINE_VISIBILITY
const_iterator find(const key_type& __k) const {return __tree_.find(__k);}
+#if _LIBCPP_STD_VER > 11
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename _VSTD::enable_if<_VSTD::__is_transparent<_Compare, _K2>::value,iterator>::type
+ find(const _K2& __k) {return __tree_.find(__k);}
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename _VSTD::enable_if<_VSTD::__is_transparent<_Compare, _K2>::value,const_iterator>::type
+ find(const _K2& __k) const {return __tree_.find(__k);}
+#endif
+
_LIBCPP_INLINE_VISIBILITY
size_type count(const key_type& __k) const
{return __tree_.__count_multi(__k);}
+
_LIBCPP_INLINE_VISIBILITY
iterator lower_bound(const key_type& __k)
{return __tree_.lower_bound(__k);}
_LIBCPP_INLINE_VISIBILITY
const_iterator lower_bound(const key_type& __k) const
{return __tree_.lower_bound(__k);}
+#if _LIBCPP_STD_VER > 11
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename _VSTD::enable_if<_VSTD::__is_transparent<_Compare, _K2>::value,iterator>::type
+ lower_bound(const _K2& __k) {return __tree_.lower_bound(__k);}
+
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename _VSTD::enable_if<_VSTD::__is_transparent<_Compare, _K2>::value,const_iterator>::type
+ lower_bound(const _K2& __k) const {return __tree_.lower_bound(__k);}
+#endif
+
_LIBCPP_INLINE_VISIBILITY
iterator upper_bound(const key_type& __k)
{return __tree_.upper_bound(__k);}
_LIBCPP_INLINE_VISIBILITY
const_iterator upper_bound(const key_type& __k) const
{return __tree_.upper_bound(__k);}
+#if _LIBCPP_STD_VER > 11
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename _VSTD::enable_if<_VSTD::__is_transparent<_Compare, _K2>::value,iterator>::type
+ upper_bound(const _K2& __k) {return __tree_.upper_bound(__k);}
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename _VSTD::enable_if<_VSTD::__is_transparent<_Compare, _K2>::value,const_iterator>::type
+ upper_bound(const _K2& __k) const {return __tree_.upper_bound(__k);}
+#endif
+
_LIBCPP_INLINE_VISIBILITY
pair<iterator,iterator> equal_range(const key_type& __k)
{return __tree_.__equal_range_multi(__k);}
_LIBCPP_INLINE_VISIBILITY
pair<const_iterator,const_iterator> equal_range(const key_type& __k) const
{return __tree_.__equal_range_multi(__k);}
+#if _LIBCPP_STD_VER > 11
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename _VSTD::enable_if<_VSTD::__is_transparent<_Compare, _K2>::value,pair<iterator,iterator>>::type
+ equal_range(const _K2& __k) {return __tree_.__equal_range_multi(__k);}
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename _VSTD::enable_if<_VSTD::__is_transparent<_Compare, _K2>::value,pair<const_iterator,const_iterator>>::type
+ equal_range(const _K2& __k) const {return __tree_.__equal_range_multi(__k);}
+#endif
};
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES