60 #if __cplusplus >= 201103L
64 namespace std _GLIBCXX_VISIBILITY(default)
66 _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
88 template<
typename _Key,
typename _Compare = std::less<_Key>,
89 typename _Alloc = std::allocator<_Key> >
93 typedef typename _Alloc::value_type _Alloc_value_type;
94 __glibcxx_class_requires(_Key, _SGIAssignableConcept)
95 __glibcxx_class_requires4(_Compare,
bool, _Key, _Key,
96 _BinaryFunctionConcept)
97 __glibcxx_class_requires2(_Key, _Alloc_value_type, _SameTypeConcept)
104 typedef _Key value_type;
105 typedef _Compare key_compare;
106 typedef _Compare value_compare;
107 typedef _Alloc allocator_type;
112 rebind<_Key>::other _Key_alloc_type;
114 typedef _Rb_tree<key_type, value_type, _Identity<value_type>,
115 key_compare, _Key_alloc_type> _Rep_type;
123 typedef typename _Alloc_traits::pointer
pointer;
124 typedef typename _Alloc_traits::const_pointer const_pointer;
125 typedef typename _Alloc_traits::reference reference;
126 typedef typename _Alloc_traits::const_reference const_reference;
130 typedef typename _Rep_type::const_iterator iterator;
131 typedef typename _Rep_type::const_iterator const_iterator;
134 typedef typename _Rep_type::size_type size_type;
135 typedef typename _Rep_type::difference_type difference_type;
143 _GLIBCXX_NOEXCEPT_IF(
144 is_nothrow_default_constructible<allocator_type>::value
145 && is_nothrow_default_constructible<key_compare>::value)
154 set(
const _Compare& __comp,
155 const allocator_type& __a = allocator_type())
156 : _M_t(__comp, _Key_alloc_type(__a)) { }
168 template<
typename _InputIterator>
169 set(_InputIterator __first, _InputIterator __last)
171 { _M_t._M_insert_unique(__first, __last); }
185 template<
typename _InputIterator>
186 set(_InputIterator __first, _InputIterator __last,
187 const _Compare& __comp,
188 const allocator_type& __a = allocator_type())
189 : _M_t(__comp, _Key_alloc_type(__a))
190 { _M_t._M_insert_unique(__first, __last); }
202 #if __cplusplus >= 201103L
211 noexcept(is_nothrow_copy_constructible<_Compare>::value)
212 : _M_t(
std::move(__x._M_t)) { }
225 const _Compare& __comp = _Compare(),
226 const allocator_type& __a = allocator_type())
227 : _M_t(__comp, _Key_alloc_type(__a))
228 { _M_t._M_insert_unique(__l.begin(), __l.end()); }
232 set(
const allocator_type& __a)
233 : _M_t(_Compare(), _Key_alloc_type(__a)) { }
236 set(
const set& __x,
const allocator_type& __a)
237 : _M_t(__x._M_t, _Key_alloc_type(__a)) { }
240 set(
set&& __x,
const allocator_type& __a)
241 noexcept(is_nothrow_copy_constructible<_Compare>::value
242 && _Alloc_traits::_S_always_equal())
243 : _M_t(
std::move(__x._M_t), _Key_alloc_type(__a)) { }
247 : _M_t(_Compare(), _Key_alloc_type(__a))
248 { _M_t._M_insert_unique(__l.begin(), __l.end()); }
251 template<
typename _InputIterator>
252 set(_InputIterator __first, _InputIterator __last,
253 const allocator_type& __a)
254 : _M_t(_Compare(), _Key_alloc_type(__a))
255 { _M_t._M_insert_unique(__first, __last); }
272 #if __cplusplus >= 201103L
291 _M_t._M_assign_unique(__l.begin(), __l.end());
301 {
return _M_t.key_comp(); }
305 {
return _M_t.key_comp(); }
309 {
return allocator_type(_M_t.get_allocator()); }
318 {
return _M_t.begin(); }
326 end() const _GLIBCXX_NOEXCEPT
327 {
return _M_t.end(); }
336 {
return _M_t.rbegin(); }
345 {
return _M_t.rend(); }
347 #if __cplusplus >= 201103L
355 {
return _M_t.begin(); }
364 {
return _M_t.end(); }
373 {
return _M_t.rbegin(); }
382 {
return _M_t.rend(); }
388 {
return _M_t.empty(); }
393 {
return _M_t.size(); }
398 {
return _M_t.max_size(); }
413 _GLIBCXX_NOEXCEPT_IF(__is_nothrow_swappable<_Compare>::value)
414 { _M_t.swap(__x._M_t); }
417 #if __cplusplus >= 201103L
431 template<
typename... _Args>
434 {
return _M_t._M_emplace_unique(std::forward<_Args>(__args)...); }
457 template<
typename... _Args>
461 return _M_t._M_emplace_hint_unique(__pos,
462 std::forward<_Args>(__args)...);
483 _M_t._M_insert_unique(__x);
487 #if __cplusplus >= 201103L
492 _M_t._M_insert_unique(std::move(__x));
517 insert(const_iterator __position,
const value_type& __x)
518 {
return _M_t._M_insert_unique_(__position, __x); }
520 #if __cplusplus >= 201103L
522 insert(const_iterator __position, value_type&& __x)
523 {
return _M_t._M_insert_unique_(__position, std::move(__x)); }
535 template<
typename _InputIterator>
537 insert(_InputIterator __first, _InputIterator __last)
538 { _M_t._M_insert_unique(__first, __last); }
540 #if __cplusplus >= 201103L
550 { this->
insert(__l.begin(), __l.end()); }
553 #if __cplusplus >= 201103L
569 _GLIBCXX_ABI_TAG_CXX11
572 {
return _M_t.erase(__position); }
586 { _M_t.erase(__position); }
602 {
return _M_t.erase(__x); }
604 #if __cplusplus >= 201103L
621 _GLIBCXX_ABI_TAG_CXX11
623 erase(const_iterator __first, const_iterator __last)
624 {
return _M_t.erase(__first, __last); }
640 { _M_t.erase(__first, __last); }
666 {
return _M_t.find(__x) == _M_t.end() ? 0 : 1; }
668 #if __cplusplus > 201103L
669 template<
typename _Kt>
671 count(
const _Kt& __x)
const
672 -> decltype(_M_t._M_count_tr(__x))
673 {
return _M_t._M_count_tr(__x); }
693 {
return _M_t.find(__x); }
697 {
return _M_t.find(__x); }
699 #if __cplusplus > 201103L
700 template<
typename _Kt>
703 -> decltype(iterator{_M_t._M_find_tr(__x)})
704 {
return iterator{_M_t._M_find_tr(__x)}; }
706 template<
typename _Kt>
708 find(
const _Kt& __x)
const
709 -> decltype(const_iterator{_M_t._M_find_tr(__x)})
710 {
return const_iterator{_M_t._M_find_tr(__x)}; }
728 {
return _M_t.lower_bound(__x); }
732 {
return _M_t.lower_bound(__x); }
734 #if __cplusplus > 201103L
735 template<
typename _Kt>
738 -> decltype(iterator(_M_t._M_lower_bound_tr(__x)))
739 {
return iterator(_M_t._M_lower_bound_tr(__x)); }
741 template<
typename _Kt>
744 -> decltype(const_iterator(_M_t._M_lower_bound_tr(__x)))
745 {
return const_iterator(_M_t._M_lower_bound_tr(__x)); }
758 {
return _M_t.upper_bound(__x); }
762 {
return _M_t.upper_bound(__x); }
764 #if __cplusplus > 201103L
765 template<
typename _Kt>
768 -> decltype(iterator(_M_t._M_upper_bound_tr(__x)))
769 {
return iterator(_M_t._M_upper_bound_tr(__x)); }
771 template<
typename _Kt>
774 -> decltype(iterator(_M_t._M_upper_bound_tr(__x)))
775 {
return const_iterator(_M_t._M_upper_bound_tr(__x)); }
797 {
return _M_t.equal_range(__x); }
801 {
return _M_t.equal_range(__x); }
803 #if __cplusplus > 201103L
804 template<
typename _Kt>
807 -> decltype(pair<iterator, iterator>(_M_t._M_equal_range_tr(__x)))
808 {
return pair<iterator, iterator>(_M_t._M_equal_range_tr(__x)); }
810 template<
typename _Kt>
813 -> decltype(pair<iterator, iterator>(_M_t._M_equal_range_tr(__x)))
814 {
return pair<iterator, iterator>(_M_t._M_equal_range_tr(__x)); }
818 template<
typename _K1,
typename _C1,
typename _A1>
820 operator==(
const set<_K1, _C1, _A1>&,
const set<_K1, _C1, _A1>&);
822 template<
typename _K1,
typename _C1,
typename _A1>
824 operator<(
const set<_K1, _C1, _A1>&,
const set<_K1, _C1, _A1>&);
838 template<
typename _Key,
typename _Compare,
typename _Alloc>
842 {
return __x._M_t == __y._M_t; }
855 template<
typename _Key,
typename _Compare,
typename _Alloc>
859 {
return __x._M_t < __y._M_t; }
862 template<
typename _Key,
typename _Compare,
typename _Alloc>
866 {
return !(__x == __y); }
869 template<
typename _Key,
typename _Compare,
typename _Alloc>
873 {
return __y < __x; }
876 template<
typename _Key,
typename _Compare,
typename _Alloc>
880 {
return !(__y < __x); }
883 template<
typename _Key,
typename _Compare,
typename _Alloc>
887 {
return !(__x < __y); }
890 template<
typename _Key,
typename _Compare,
typename _Alloc>
893 _GLIBCXX_NOEXCEPT_IF(noexcept(__x.swap(__y)))
896 _GLIBCXX_END_NAMESPACE_CONTAINER