63 namespace std _GLIBCXX_VISIBILITY(default)
65 _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
87 template<
typename _Key,
typename _Compare = std::less<_Key>,
88 typename _Alloc = std::allocator<_Key> >
92 typedef typename _Alloc::value_type _Alloc_value_type;
93 __glibcxx_class_requires(_Key, _SGIAssignableConcept)
94 __glibcxx_class_requires4(_Compare,
bool, _Key, _Key,
95 _BinaryFunctionConcept)
96 __glibcxx_class_requires2(_Key, _Alloc_value_type, _SameTypeConcept)
110 typedef typename _Alloc::template rebind<_Key>::other _Key_alloc_type;
112 typedef _Rb_tree<key_type, value_type, _Identity<value_type>,
119 typedef typename _Key_alloc_type::pointer
pointer;
126 typedef typename _Rep_type::const_iterator
iterator;
147 set(
const _Compare& __comp,
149 : _M_t(__comp, __a) { }
160 template<
typename _InputIterator>
161 set(_InputIterator __first, _InputIterator __last)
163 { _M_t._M_insert_unique(__first, __last); }
176 template<
typename _InputIterator>
177 set(_InputIterator __first, _InputIterator __last,
178 const _Compare& __comp,
181 { _M_t._M_insert_unique(__first, __last); }
193 #ifdef __GXX_EXPERIMENTAL_CXX0X__
202 : _M_t(std::move(__x._M_t)) { }
215 const _Compare& __comp = _Compare(),
218 { _M_t._M_insert_unique(__l.begin(), __l.end()); }
235 #ifdef __GXX_EXPERIMENTAL_CXX0X__
268 this->
insert(__l.begin(), __l.end());
278 {
return _M_t.key_comp(); }
282 {
return _M_t.key_comp(); }
286 {
return _M_t.get_allocator(); }
295 {
return _M_t.begin(); }
304 {
return _M_t.end(); }
313 {
return _M_t.rbegin(); }
322 {
return _M_t.rend(); }
324 #ifdef __GXX_EXPERIMENTAL_CXX0X__
332 {
return _M_t.begin(); }
341 {
return _M_t.end(); }
350 {
return _M_t.rbegin(); }
359 {
return _M_t.rend(); }
365 {
return _M_t.empty(); }
370 {
return _M_t.size(); }
375 {
return _M_t.max_size(); }
390 { _M_t.swap(__x._M_t); }
410 _M_t._M_insert_unique(__x);
414 #ifdef __GXX_EXPERIMENTAL_CXX0X__
419 _M_t._M_insert_unique(std::move(__x));
445 {
return _M_t._M_insert_unique_(__position, __x); }
447 #ifdef __GXX_EXPERIMENTAL_CXX0X__
450 {
return _M_t._M_insert_unique_(__position, std::move(__x)); }
462 template<
typename _InputIterator>
464 insert(_InputIterator __first, _InputIterator __last)
465 { _M_t._M_insert_unique(__first, __last); }
467 #ifdef __GXX_EXPERIMENTAL_CXX0X__
477 { this->
insert(__l.begin(), __l.end()); }
480 #ifdef __GXX_EXPERIMENTAL_CXX0X__
498 {
return _M_t.erase(__position); }
512 { _M_t.erase(__position); }
528 {
return _M_t.erase(__x); }
530 #ifdef __GXX_EXPERIMENTAL_CXX0X__
547 {
return _M_t.erase(__first, __last); }
562 { _M_t.erase(__first, __last); }
587 {
return _M_t.find(__x) == _M_t.end() ? 0 : 1; }
605 {
return _M_t.find(__x); }
609 {
return _M_t.find(__x); }
626 {
return _M_t.lower_bound(__x); }
630 {
return _M_t.lower_bound(__x); }
642 {
return _M_t.upper_bound(__x); }
646 {
return _M_t.upper_bound(__x); }
667 {
return _M_t.equal_range(__x); }
671 {
return _M_t.equal_range(__x); }
674 template<
typename _K1,
typename _C1,
typename _A1>
678 template<
typename _K1,
typename _C1,
typename _A1>
694 template<
typename _Key,
typename _Compare,
typename _Alloc>
698 {
return __x._M_t == __y._M_t; }
711 template<
typename _Key,
typename _Compare,
typename _Alloc>
713 operator<(const set<_Key, _Compare, _Alloc>& __x,
715 {
return __x._M_t < __y._M_t; }
718 template<
typename _Key,
typename _Compare,
typename _Alloc>
722 {
return !(__x == __y); }
725 template<
typename _Key,
typename _Compare,
typename _Alloc>
729 {
return __y < __x; }
732 template<
typename _Key,
typename _Compare,
typename _Alloc>
734 operator<=(const set<_Key, _Compare, _Alloc>& __x,
736 {
return !(__y < __x); }
739 template<
typename _Key,
typename _Compare,
typename _Alloc>
743 {
return !(__x < __y); }
746 template<
typename _Key,
typename _Compare,
typename _Alloc>
751 _GLIBCXX_END_NAMESPACE_CONTAINER
iterator erase(const_iterator __first, const_iterator __last)
Erases a [first,last) range of elements from a set.
_Key_alloc_type::const_reference const_reference
Iterator-related typedefs.
Struct holding two objects of arbitrary type.
_T1 first
second_type is the second bound type
set()
Default constructor creates no elements.
set(set &&__x)
Set move constructor
std::pair< iterator, iterator > equal_range(const key_type &__x)
Finds a subsequence matching given key.
_Rep_type::difference_type difference_type
Iterator-related typedefs.
_Key_alloc_type::reference reference
Iterator-related typedefs.
set(const set &__x)
Set copy constructor.
set(const _Compare &__comp, const allocator_type &__a=allocator_type())
Creates a set with no elements.
set & operator=(const set &__x)
Set assignment operator.
_Compare key_compare
Public typedefs.
set & operator=(set &&__x)
Set move assignment operator.
reverse_iterator crbegin() const
value_compare value_comp() const
Returns the comparison object with which the set was constructed.
iterator find(const key_type &__x)
Tries to locate an element in a set.
_Rep_type::const_reverse_iterator reverse_iterator
Iterator-related typedefs.
_Rep_type::const_reverse_iterator const_reverse_iterator
Iterator-related typedefs.
_Rep_type::size_type size_type
Iterator-related typedefs.
_Rep_type::const_iterator const_iterator
Iterator-related typedefs.
_Compare value_compare
Public typedefs.
size_type count(const key_type &__x) const
Finds the number of elements.
void insert(_InputIterator __first, _InputIterator __last)
A template function that attempts to insert a range of elements.
set(initializer_list< value_type > __l, const _Compare &__comp=_Compare(), const allocator_type &__a=allocator_type())
Builds a set from an initializer_list.
iterator upper_bound(const key_type &__x)
Finds the end of a subsequence matching given key.
allocator_type get_allocator() const
Returns the allocator object with which the set was constructed.
const_iterator lower_bound(const key_type &__x) const
Finds the beginning of a subsequence matching given key.
size_type size() const
Returns the size of the set.
bool empty() const
Returns true if the set is empty.
size_type max_size() const
Returns the maximum size of the set.
_Key key_type
Public typedefs.
reverse_iterator rend() const
_Key value_type
Public typedefs.
std::pair< iterator, bool > insert(const value_type &__x)
Attempts to insert an element into the set.
set & operator=(initializer_list< value_type > __l)
Set list assignment operator.
void swap(set &__x)
Swaps data with another set.
_Rep_type::const_iterator iterator
Iterator-related typedefs.
A standard container made up of unique keys, which can be retrieved in logarithmic time...
iterator erase(const_iterator __position)
Erases an element from a set.
_Key_alloc_type::pointer pointer
Iterator-related typedefs.
reverse_iterator crend() const
key_compare key_comp() const
Returns the comparison object with which the set was constructed.
set(_InputIterator __first, _InputIterator __last, const _Compare &__comp, const allocator_type &__a=allocator_type())
Builds a set from a range.
iterator lower_bound(const key_type &__x)
Finds the beginning of a subsequence matching given key.
set(_InputIterator __first, _InputIterator __last)
Builds a set from a range.
std::pair< const_iterator, const_iterator > equal_range(const key_type &__x) const
Finds a subsequence matching given key.
_Alloc allocator_type
Public typedefs.
const_iterator upper_bound(const key_type &__x) const
Finds the end of a subsequence matching given key.
reverse_iterator rbegin() const
The standard allocator, as per [20.4].Further details: http://gcc.gnu.org/onlinedocs/libstdc++/manual...
_T2 second
first is a copy of the first object
void insert(initializer_list< value_type > __l)
Attempts to insert a list of elements into the set.
size_type erase(const key_type &__x)
Erases elements according to the provided key.
_Key_alloc_type::const_pointer const_pointer
Iterator-related typedefs.
iterator insert(const_iterator __position, const value_type &__x)
Attempts to insert an element into the set.
const_iterator find(const key_type &__x) const
Tries to locate an element in a set.