.TH "std::set< _Key, _Compare, _Alloc >" 3cxx "Thu Aug 2 2012" "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::set< _Key, _Compare, _Alloc > \- .SH SYNOPSIS .br .PP .SS "Public Types" .PP .RI "\fB\fP" .br .in +1c .in +1c .ti -1c .RI "typedef _Key \fBkey_type\fP" .br .ti -1c .RI "typedef _Key \fBvalue_type\fP" .br .ti -1c .RI "typedef _Compare \fBkey_compare\fP" .br .ti -1c .RI "typedef _Compare \fBvalue_compare\fP" .br .ti -1c .RI "typedef _Alloc \fBallocator_type\fP" .br .in -1c .in -1c .PP .RI "\fB\fP" .br .in +1c .in +1c .ti -1c .RI "typedef _Key_alloc_type::pointer \fBpointer\fP" .br .ti -1c .RI "typedef .br _Key_alloc_type::const_pointer \fBconst_pointer\fP" .br .ti -1c .RI "typedef _Key_alloc_type::reference \fBreference\fP" .br .ti -1c .RI "typedef .br _Key_alloc_type::const_reference \fBconst_reference\fP" .br .ti -1c .RI "typedef _Rep_type::const_iterator \fBiterator\fP" .br .ti -1c .RI "typedef _Rep_type::const_iterator \fBconst_iterator\fP" .br .ti -1c .RI "typedef .br \fB_Rep_type::const_reverse_iterator\fP \fBreverse_iterator\fP" .br .ti -1c .RI "typedef .br \fB_Rep_type::const_reverse_iterator\fP \fBconst_reverse_iterator\fP" .br .ti -1c .RI "typedef _Rep_type::size_type \fBsize_type\fP" .br .ti -1c .RI "typedef _Rep_type::difference_type \fBdifference_type\fP" .br .in -1c .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBiterator\fP \fBbegin\fP () const " .br .ti -1c .RI "\fBiterator\fP \fBcbegin\fP () const " .br .ti -1c .RI "\fBiterator\fP \fBcend\fP () const " .br .ti -1c .RI "void \fBclear\fP ()" .br .ti -1c .RI "\fBsize_type\fP \fBcount\fP (const \fBkey_type\fP &__x) const " .br .ti -1c .RI "\fBreverse_iterator\fP \fBcrbegin\fP () const " .br .ti -1c .RI "\fBreverse_iterator\fP \fBcrend\fP () const " .br .ti -1c .RI "bool \fBempty\fP () const " .br .ti -1c .RI "\fBiterator\fP \fBend\fP () const " .br .ti -1c .RI "void \fBerase\fP (\fBiterator\fP __position)" .br .ti -1c .RI "\fBsize_type\fP \fBerase\fP (const \fBkey_type\fP &__x)" .br .ti -1c .RI "void \fBerase\fP (\fBiterator\fP __first, \fBiterator\fP __last)" .br .ti -1c .RI "\fBallocator_type\fP \fBget_allocator\fP () const " .br .ti -1c .RI "\fBstd::pair\fP< \fBiterator\fP, bool > \fBinsert\fP (const \fBvalue_type\fP &__x)" .br .ti -1c .RI "\fBiterator\fP \fBinsert\fP (\fBiterator\fP __position, const \fBvalue_type\fP &__x)" .br .ti -1c .RI "template void \fBinsert\fP (_InputIterator __first, _InputIterator __last)" .br .ti -1c .RI "void \fBinsert\fP (\fBinitializer_list\fP< \fBvalue_type\fP > __l)" .br .ti -1c .RI "\fBkey_compare\fP \fBkey_comp\fP () const " .br .ti -1c .RI "\fBsize_type\fP \fBmax_size\fP () const " .br .ti -1c .RI "\fBset\fP & \fBoperator=\fP (const \fBset\fP &__x)" .br .ti -1c .RI "\fBset\fP & \fBoperator=\fP (\fBset\fP &&__x)" .br .ti -1c .RI "\fBset\fP & \fBoperator=\fP (\fBinitializer_list\fP< \fBvalue_type\fP > __l)" .br .ti -1c .RI "\fBreverse_iterator\fP \fBrbegin\fP () const " .br .ti -1c .RI "\fBreverse_iterator\fP \fBrend\fP () const " .br .ti -1c .RI "\fBset\fP ()" .br .ti -1c .RI "\fBset\fP (const _Compare &__comp, const \fBallocator_type\fP &__a=\fBallocator_type\fP())" .br .ti -1c .RI "template \fBset\fP (_InputIterator __first, _InputIterator __last)" .br .ti -1c .RI "template \fBset\fP (_InputIterator __first, _InputIterator __last, const _Compare &__comp, const \fBallocator_type\fP &__a=\fBallocator_type\fP())" .br .ti -1c .RI "\fBset\fP (const \fBset\fP &__x)" .br .ti -1c .RI "\fBset\fP (\fBset\fP &&__x)" .br .ti -1c .RI "\fBset\fP (\fBinitializer_list\fP< \fBvalue_type\fP > __l, const _Compare &__comp=_Compare(), const \fBallocator_type\fP &__a=\fBallocator_type\fP())" .br .ti -1c .RI "\fBsize_type\fP \fBsize\fP () const " .br .ti -1c .RI "void \fBswap\fP (\fBset\fP &&__x)" .br .ti -1c .RI "\fBvalue_compare\fP \fBvalue_comp\fP () const " .br .in -1c .PP .RI "\fB\fP" .br .in +1c .in +1c .ti -1c .RI "\fBiterator\fP \fBfind\fP (const \fBkey_type\fP &__x)" .br .ti -1c .RI "\fBconst_iterator\fP \fBfind\fP (const \fBkey_type\fP &__x) const " .br .in -1c .in -1c .PP .RI "\fB\fP" .br .in +1c .in +1c .ti -1c .RI "\fBiterator\fP \fBlower_bound\fP (const \fBkey_type\fP &__x)" .br .ti -1c .RI "\fBconst_iterator\fP \fBlower_bound\fP (const \fBkey_type\fP &__x) const " .br .in -1c .in -1c .PP .RI "\fB\fP" .br .in +1c .in +1c .ti -1c .RI "\fBiterator\fP \fBupper_bound\fP (const \fBkey_type\fP &__x)" .br .ti -1c .RI "\fBconst_iterator\fP \fBupper_bound\fP (const \fBkey_type\fP &__x) const " .br .in -1c .in -1c .PP .RI "\fB\fP" .br .in +1c .in +1c .ti -1c .RI "\fBstd::pair\fP< \fBiterator\fP, \fBiterator\fP > \fBequal_range\fP (const \fBkey_type\fP &__x)" .br .ti -1c .RI "\fBstd::pair\fP< \fBconst_iterator\fP, .br \fBconst_iterator\fP > \fBequal_range\fP (const \fBkey_type\fP &__x) const " .br .in -1c .in -1c .SS "Friends" .in +1c .ti -1c .RI "template bool \fBoperator<\fP (const \fBset\fP< _K1, _C1, _A1 > &, const \fBset\fP< _K1, _C1, _A1 > &)" .br .ti -1c .RI "template bool \fBoperator==\fP (const \fBset\fP< _K1, _C1, _A1 > &, const \fBset\fP< _K1, _C1, _A1 > &)" .br .in -1c .SH "Detailed Description" .PP .SS "template, typename _Alloc = std::allocator<_Key>>class std::set< _Key, _Compare, _Alloc >" A standard container made up of unique keys, which can be retrieved in logarithmic time\&. Meets the requirements of a \fCcontainer\fP, a \fCreversible container\fP, and an \fCassociative container\fP (using unique keys)\&. .PP Sets support bidirectional iterators\&. .PP \fBParameters:\fP .RS 4 \fIKey\fP Type of key objects\&. .br \fICompare\fP Comparison function object type, defaults to less\&. .br \fIAlloc\fP Allocator type, defaults to allocator\&. .RE .PP The private tree data is declared exactly the same way for set and multiset; the distinction is made entirely in how the tree functions are called (*_unique versus *_equal, same as the standard)\&. .PP Definition at line 87 of file stl_set\&.h\&. .SH "Member Typedef Documentation" .PP .SS "template, typename _Alloc = std::allocator<_Key>> typedef _Alloc \fBstd::set\fP< _Key, _Compare, _Alloc >::\fBallocator_type\fP" .PP Public typedefs\&. .PP Definition at line 104 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> typedef _Rep_type::const_iterator \fBstd::set\fP< _Key, _Compare, _Alloc >::\fBconst_iterator\fP" .PP Iterator-related typedefs\&. .PP Definition at line 125 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> typedef _Key_alloc_type::const_pointer \fBstd::set\fP< _Key, _Compare, _Alloc >::\fBconst_pointer\fP" .PP Iterator-related typedefs\&. .PP Definition at line 118 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> typedef _Key_alloc_type::const_reference \fBstd::set\fP< _Key, _Compare, _Alloc >::\fBconst_reference\fP" .PP Iterator-related typedefs\&. .PP Definition at line 120 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> typedef \fB_Rep_type::const_reverse_iterator\fP \fBstd::set\fP< _Key, _Compare, _Alloc >::\fBconst_reverse_iterator\fP" .PP Iterator-related typedefs\&. .PP Definition at line 127 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> typedef _Rep_type::difference_type \fBstd::set\fP< _Key, _Compare, _Alloc >::\fBdifference_type\fP" .PP Iterator-related typedefs\&. .PP Definition at line 129 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> typedef _Rep_type::const_iterator \fBstd::set\fP< _Key, _Compare, _Alloc >::\fBiterator\fP" .PP Iterator-related typedefs\&. .PP Definition at line 124 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> typedef _Compare \fBstd::set\fP< _Key, _Compare, _Alloc >::\fBkey_compare\fP" .PP Public typedefs\&. .PP Definition at line 102 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> typedef _Key \fBstd::set\fP< _Key, _Compare, _Alloc >::\fBkey_type\fP" .PP Public typedefs\&. .PP Definition at line 100 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> typedef _Key_alloc_type::pointer \fBstd::set\fP< _Key, _Compare, _Alloc >::\fBpointer\fP" .PP Iterator-related typedefs\&. .PP Definition at line 117 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> typedef _Key_alloc_type::reference \fBstd::set\fP< _Key, _Compare, _Alloc >::\fBreference\fP" .PP Iterator-related typedefs\&. .PP Definition at line 119 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> typedef \fB_Rep_type::const_reverse_iterator\fP \fBstd::set\fP< _Key, _Compare, _Alloc >::\fBreverse_iterator\fP" .PP Iterator-related typedefs\&. .PP Definition at line 126 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> typedef _Rep_type::size_type \fBstd::set\fP< _Key, _Compare, _Alloc >::\fBsize_type\fP" .PP Iterator-related typedefs\&. .PP Definition at line 128 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> typedef _Compare \fBstd::set\fP< _Key, _Compare, _Alloc >::\fBvalue_compare\fP" .PP Public typedefs\&. .PP Definition at line 103 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> typedef _Key \fBstd::set\fP< _Key, _Compare, _Alloc >::\fBvalue_type\fP" .PP Public typedefs\&. .PP Definition at line 101 of file stl_set\&.h\&. .SH "Constructor & Destructor Documentation" .PP .SS "template, typename _Alloc = std::allocator<_Key>> \fBstd::set\fP< _Key, _Compare, _Alloc >::\fBset\fP ()\fC [inline]\fP" .PP Default constructor creates no elements\&. .PP Definition at line 136 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> \fBstd::set\fP< _Key, _Compare, _Alloc >::\fBset\fP (const _Compare &__comp, const \fBallocator_type\fP &__a = \fC\fBallocator_type\fP()\fP)\fC [inline]\fP, \fC [explicit]\fP" .PP Creates a set with no elements\&. \fBParameters:\fP .RS 4 \fIcomp\fP Comparator to use\&. .br \fIa\fP An allocator object\&. .RE .PP .PP Definition at line 145 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> template \fBstd::set\fP< _Key, _Compare, _Alloc >::\fBset\fP (_InputIterator__first, _InputIterator__last)\fC [inline]\fP" .PP Builds a set from a range\&. \fBParameters:\fP .RS 4 \fIfirst\fP An input iterator\&. .br \fIlast\fP An input iterator\&. .RE .PP Create a set consisting of copies of the elements from [first,last)\&. This is linear in N if the range is already sorted, and NlogN otherwise (where N is distance(first,last))\&. .PP Definition at line 159 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> template \fBstd::set\fP< _Key, _Compare, _Alloc >::\fBset\fP (_InputIterator__first, _InputIterator__last, const _Compare &__comp, const \fBallocator_type\fP &__a = \fC\fBallocator_type\fP()\fP)\fC [inline]\fP" .PP Builds a set from a range\&. \fBParameters:\fP .RS 4 \fIfirst\fP An input iterator\&. .br \fIlast\fP An input iterator\&. .br \fIcomp\fP A comparison functor\&. .br \fIa\fP An allocator object\&. .RE .PP Create a set consisting of copies of the elements from [first,last)\&. This is linear in N if the range is already sorted, and NlogN otherwise (where N is distance(first,last))\&. .PP Definition at line 175 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> \fBstd::set\fP< _Key, _Compare, _Alloc >::\fBset\fP (const \fBset\fP< _Key, _Compare, _Alloc > &__x)\fC [inline]\fP" .PP Set copy constructor\&. \fBParameters:\fP .RS 4 \fIx\fP A set of identical element and allocator types\&. .RE .PP The newly-created set uses a copy of the allocation object used by \fIx\fP\&. .PP Definition at line 188 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> \fBstd::set\fP< _Key, _Compare, _Alloc >::\fBset\fP (\fBset\fP< _Key, _Compare, _Alloc > &&__x)\fC [inline]\fP" .PP Set move constructor \fBParameters:\fP .RS 4 \fIx\fP A set of identical element and allocator types\&. .RE .PP The newly-created set contains the exact contents of \fIx\fP\&. The contents of \fIx\fP are a valid, but unspecified set\&. .PP Definition at line 199 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> \fBstd::set\fP< _Key, _Compare, _Alloc >::\fBset\fP (\fBinitializer_list\fP< \fBvalue_type\fP >__l, const _Compare &__comp = \fC_Compare()\fP, const \fBallocator_type\fP &__a = \fC\fBallocator_type\fP()\fP)\fC [inline]\fP" .PP Builds a set from an \fBinitializer_list\fP\&. \fBParameters:\fP .RS 4 \fIl\fP An \fBinitializer_list\fP\&. .br \fIcomp\fP A comparison functor\&. .br \fIa\fP An allocator object\&. .RE .PP Create a set consisting of copies of the elements in the list\&. This is linear in N if the list is already sorted, and NlogN otherwise (where N is \fIl\&.size()\fP)\&. .PP Definition at line 212 of file stl_set\&.h\&. .SH "Member Function Documentation" .PP .SS "template, typename _Alloc = std::allocator<_Key>> \fBiterator\fP \fBstd::set\fP< _Key, _Compare, _Alloc >::begin () const\fC [inline]\fP" Returns a read-only (constant) iterator that points to the first element in the set\&. Iteration is done in ascending order according to the keys\&. .PP Definition at line 291 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> \fBiterator\fP \fBstd::set\fP< _Key, _Compare, _Alloc >::cbegin () const\fC [inline]\fP" Returns a read-only (constant) iterator that points to the first element in the set\&. Iteration is done in ascending order according to the keys\&. .PP Definition at line 328 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> \fBiterator\fP \fBstd::set\fP< _Key, _Compare, _Alloc >::cend () const\fC [inline]\fP" Returns a read-only (constant) iterator that points one past the last element in the set\&. Iteration is done in ascending order according to the keys\&. .PP Definition at line 337 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> void \fBstd::set\fP< _Key, _Compare, _Alloc >::clear ()\fC [inline]\fP" Erases all elements in a set\&. Note that this function only erases the elements, and that if the elements themselves are pointers, the pointed-to memory is not touched in any way\&. Managing the pointer is the user's responsibility\&. .PP Definition at line 515 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> \fBsize_type\fP \fBstd::set\fP< _Key, _Compare, _Alloc >::count (const \fBkey_type\fP &__x) const\fC [inline]\fP" .PP Finds the number of elements\&. \fBParameters:\fP .RS 4 \fIx\fP Element to located\&. .RE .PP \fBReturns:\fP .RS 4 Number of elements with specified key\&. .RE .PP This function only makes sense for multisets; for set the result will either be 0 (not present) or 1 (present)\&. .PP Definition at line 529 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> \fBreverse_iterator\fP \fBstd::set\fP< _Key, _Compare, _Alloc >::crbegin () const\fC [inline]\fP" Returns a read-only (constant) iterator that points to the last element in the set\&. Iteration is done in descending order according to the keys\&. .PP Definition at line 346 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> \fBreverse_iterator\fP \fBstd::set\fP< _Key, _Compare, _Alloc >::crend () const\fC [inline]\fP" Returns a read-only (constant) reverse iterator that points to the last pair in the set\&. Iteration is done in descending order according to the keys\&. .PP Definition at line 355 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> bool \fBstd::set\fP< _Key, _Compare, _Alloc >::empty () const\fC [inline]\fP" .PP Returns true if the set is empty\&. .PP Definition at line 361 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> \fBiterator\fP \fBstd::set\fP< _Key, _Compare, _Alloc >::end () const\fC [inline]\fP" Returns a read-only (constant) iterator that points one past the last element in the set\&. Iteration is done in ascending order according to the keys\&. .PP Definition at line 300 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> \fBstd::pair\fP<\fBiterator\fP, \fBiterator\fP> \fBstd::set\fP< _Key, _Compare, _Alloc >::equal_range (const \fBkey_type\fP &__x)\fC [inline]\fP" .PP Finds a subsequence matching given key\&. \fBParameters:\fP .RS 4 \fIx\fP Key to be located\&. .RE .PP \fBReturns:\fP .RS 4 Pair of iterators that possibly points to the subsequence matching given key\&. .RE .PP This function is equivalent to .PP .nf std::make_pair(c\&.lower_bound(val), c\&.upper_bound(val)) .fi .PP (but is faster than making the calls separately)\&. .PP This function probably only makes sense for multisets\&. .PP Definition at line 609 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> \fBstd::pair\fP<\fBconst_iterator\fP, \fBconst_iterator\fP> \fBstd::set\fP< _Key, _Compare, _Alloc >::equal_range (const \fBkey_type\fP &__x) const\fC [inline]\fP" .PP Finds a subsequence matching given key\&. \fBParameters:\fP .RS 4 \fIx\fP Key to be located\&. .RE .PP \fBReturns:\fP .RS 4 Pair of iterators that possibly points to the subsequence matching given key\&. .RE .PP This function is equivalent to .PP .nf std::make_pair(c\&.lower_bound(val), c\&.upper_bound(val)) .fi .PP (but is faster than making the calls separately)\&. .PP This function probably only makes sense for multisets\&. .PP Definition at line 613 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> void \fBstd::set\fP< _Key, _Compare, _Alloc >::erase (\fBiterator\fP__position)\fC [inline]\fP" .PP Erases an element from a set\&. \fBParameters:\fP .RS 4 \fIposition\fP An iterator pointing to the element to be erased\&. .RE .PP This function erases an element, pointed to by the given iterator, from a set\&. Note that this function only erases the element, and that if the element is itself a pointer, the pointed-to memory is not touched in any way\&. Managing the pointer is the user's responsibility\&. .PP Definition at line 475 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> \fBsize_type\fP \fBstd::set\fP< _Key, _Compare, _Alloc >::erase (const \fBkey_type\fP &__x)\fC [inline]\fP" .PP Erases elements according to the provided key\&. \fBParameters:\fP .RS 4 \fIx\fP Key of element to be erased\&. .RE .PP \fBReturns:\fP .RS 4 The number of elements erased\&. .RE .PP This function erases all the elements located by the given key from a set\&. Note that this function only erases the element, and that if the element is itself a pointer, the pointed-to memory is not touched in any way\&. Managing the pointer is the user's responsibility\&. .PP Definition at line 490 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> void \fBstd::set\fP< _Key, _Compare, _Alloc >::erase (\fBiterator\fP__first, \fBiterator\fP__last)\fC [inline]\fP" .PP Erases a [first,last) range of elements from a set\&. \fBParameters:\fP .RS 4 \fIfirst\fP Iterator pointing to the start of the range to be erased\&. .br \fIlast\fP Iterator pointing to the end of the range to be erased\&. .RE .PP This function erases a sequence of elements from a set\&. Note that this function only erases the element, and that if the element is itself a pointer, the pointed-to memory is not touched in any way\&. Managing the pointer is the user's responsibility\&. .PP Definition at line 505 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> \fBiterator\fP \fBstd::set\fP< _Key, _Compare, _Alloc >::find (const \fBkey_type\fP &__x)\fC [inline]\fP" .PP Tries to locate an element in a set\&. \fBParameters:\fP .RS 4 \fIx\fP Element to be located\&. .RE .PP \fBReturns:\fP .RS 4 Iterator pointing to sought-after element, or \fBend()\fP if not found\&. .RE .PP This function takes a key and tries to locate the element with which the key matches\&. If successful the function returns an iterator pointing to the sought after element\&. If unsuccessful it returns the past-the-end ( \fC\fBend()\fP\fP ) iterator\&. .PP Definition at line 547 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> \fBconst_iterator\fP \fBstd::set\fP< _Key, _Compare, _Alloc >::find (const \fBkey_type\fP &__x) const\fC [inline]\fP" .PP Tries to locate an element in a set\&. \fBParameters:\fP .RS 4 \fIx\fP Element to be located\&. .RE .PP \fBReturns:\fP .RS 4 Iterator pointing to sought-after element, or \fBend()\fP if not found\&. .RE .PP This function takes a key and tries to locate the element with which the key matches\&. If successful the function returns an iterator pointing to the sought after element\&. If unsuccessful it returns the past-the-end ( \fC\fBend()\fP\fP ) iterator\&. .PP Definition at line 551 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> \fBallocator_type\fP \fBstd::set\fP< _Key, _Compare, _Alloc >::get_allocator () const\fC [inline]\fP" .PP Returns the allocator object with which the set was constructed\&. .PP Definition at line 282 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> \fBstd::pair\fP<\fBiterator\fP, bool> \fBstd::set\fP< _Key, _Compare, _Alloc >::insert (const \fBvalue_type\fP &__x)\fC [inline]\fP" .PP Attempts to insert an element into the set\&. \fBParameters:\fP .RS 4 \fIx\fP Element to be inserted\&. .RE .PP \fBReturns:\fP .RS 4 A pair, of which the first element is an iterator that points to the possibly inserted element, and the second is a bool that is true if the element was actually inserted\&. .RE .PP This function attempts to insert an element into the set\&. A set relies on unique keys and thus an element is only inserted if it is not already present in the set\&. .PP Insertion requires logarithmic time\&. .PP Definition at line 408 of file stl_set\&.h\&. .PP References std::pair< _T1, _T2 >::first, and std::pair< _T1, _T2 >::second\&. .SS "template, typename _Alloc = std::allocator<_Key>> \fBiterator\fP \fBstd::set\fP< _Key, _Compare, _Alloc >::insert (\fBiterator\fP__position, const \fBvalue_type\fP &__x)\fC [inline]\fP" .PP Attempts to insert an element into the set\&. \fBParameters:\fP .RS 4 \fIposition\fP An iterator that serves as a hint as to where the element should be inserted\&. .br \fIx\fP Element to be inserted\&. .RE .PP \fBReturns:\fP .RS 4 An iterator that points to the element with key of \fIx\fP (may or may not be the element passed in)\&. .RE .PP This function is not concerned about whether the insertion took place, and thus does not return a boolean like the single-argument \fBinsert()\fP does\&. Note that the first parameter is only a hint and can potentially improve the performance of the insertion process\&. A bad hint would cause no gains in efficiency\&. .PP For more on 'hinting', see: http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt07ch17.html .PP Insertion requires logarithmic time (if the hint is not taken)\&. .PP Definition at line 435 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> template void \fBstd::set\fP< _Key, _Compare, _Alloc >::insert (_InputIterator__first, _InputIterator__last)\fC [inline]\fP" .PP A template function that attempts to insert a range of elements\&. \fBParameters:\fP .RS 4 \fIfirst\fP Iterator pointing to the start of the range to be inserted\&. .br \fIlast\fP Iterator pointing to the end of the range\&. .RE .PP Complexity similar to that of the range constructor\&. .PP Definition at line 449 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> void \fBstd::set\fP< _Key, _Compare, _Alloc >::insert (\fBinitializer_list\fP< \fBvalue_type\fP >__l)\fC [inline]\fP" .PP Attempts to insert a list of elements into the set\&. \fBParameters:\fP .RS 4 \fIlist\fP A std::initializer_list of elements to be inserted\&. .RE .PP Complexity similar to that of the range constructor\&. .PP Definition at line 461 of file stl_set\&.h\&. .PP References std::set< _Key, _Compare, _Alloc >::insert()\&. .PP Referenced by std::set< _Key, _Compare, _Alloc >::insert()\&. .SS "template, typename _Alloc = std::allocator<_Key>> \fBkey_compare\fP \fBstd::set\fP< _Key, _Compare, _Alloc >::key_comp () const\fC [inline]\fP" .PP Returns the comparison object with which the set was constructed\&. .PP Definition at line 274 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> \fBiterator\fP \fBstd::set\fP< _Key, _Compare, _Alloc >::lower_bound (const \fBkey_type\fP &__x)\fC [inline]\fP" .PP Finds the beginning of a subsequence matching given key\&. \fBParameters:\fP .RS 4 \fIx\fP Key to be located\&. .RE .PP \fBReturns:\fP .RS 4 Iterator pointing to first element equal to or greater than key, or \fBend()\fP\&. .RE .PP This function returns the first element of a subsequence of elements that matches the given key\&. If unsuccessful it returns an iterator pointing to the first element that has a greater value than given key or \fBend()\fP if no such element exists\&. .PP Definition at line 568 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> \fBconst_iterator\fP \fBstd::set\fP< _Key, _Compare, _Alloc >::lower_bound (const \fBkey_type\fP &__x) const\fC [inline]\fP" .PP Finds the beginning of a subsequence matching given key\&. \fBParameters:\fP .RS 4 \fIx\fP Key to be located\&. .RE .PP \fBReturns:\fP .RS 4 Iterator pointing to first element equal to or greater than key, or \fBend()\fP\&. .RE .PP This function returns the first element of a subsequence of elements that matches the given key\&. If unsuccessful it returns an iterator pointing to the first element that has a greater value than given key or \fBend()\fP if no such element exists\&. .PP Definition at line 572 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> \fBsize_type\fP \fBstd::set\fP< _Key, _Compare, _Alloc >::max_size () const\fC [inline]\fP" .PP Returns the maximum size of the set\&. .PP Definition at line 371 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> \fBset\fP& \fBstd::set\fP< _Key, _Compare, _Alloc >::operator= (const \fBset\fP< _Key, _Compare, _Alloc > &__x)\fC [inline]\fP" .PP Set assignment operator\&. \fBParameters:\fP .RS 4 \fIx\fP A set of identical element and allocator types\&. .RE .PP All the elements of \fIx\fP are copied, but unlike the copy constructor, the allocator object is not copied\&. .PP Definition at line 227 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> \fBset\fP& \fBstd::set\fP< _Key, _Compare, _Alloc >::operator= (\fBset\fP< _Key, _Compare, _Alloc > &&__x)\fC [inline]\fP" .PP Set move assignment operator\&. \fBParameters:\fP .RS 4 \fIx\fP A set of identical element and allocator types\&. .RE .PP The contents of \fIx\fP are moved into this set (without copying)\&. \fIx\fP is a valid, but unspecified set\&. .PP Definition at line 242 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> \fBset\fP& \fBstd::set\fP< _Key, _Compare, _Alloc >::operator= (\fBinitializer_list\fP< \fBvalue_type\fP >__l)\fC [inline]\fP" .PP Set list assignment operator\&. \fBParameters:\fP .RS 4 \fIl\fP An \fBinitializer_list\fP\&. .RE .PP This function fills a set with copies of the elements in the initializer list \fIl\fP\&. .PP Note that the assignment completely changes the set and that the resulting set's size is the same as the number of elements assigned\&. Old data may be lost\&. .PP Definition at line 262 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> \fBreverse_iterator\fP \fBstd::set\fP< _Key, _Compare, _Alloc >::rbegin () const\fC [inline]\fP" Returns a read-only (constant) iterator that points to the last element in the set\&. Iteration is done in descending order according to the keys\&. .PP Definition at line 309 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> \fBreverse_iterator\fP \fBstd::set\fP< _Key, _Compare, _Alloc >::rend () const\fC [inline]\fP" Returns a read-only (constant) reverse iterator that points to the last pair in the set\&. Iteration is done in descending order according to the keys\&. .PP Definition at line 318 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> \fBsize_type\fP \fBstd::set\fP< _Key, _Compare, _Alloc >::size () const\fC [inline]\fP" .PP Returns the size of the set\&. .PP Definition at line 366 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> void \fBstd::set\fP< _Key, _Compare, _Alloc >::swap (\fBset\fP< _Key, _Compare, _Alloc > &&__x)\fC [inline]\fP" .PP Swaps data with another set\&. \fBParameters:\fP .RS 4 \fIx\fP A set of the same element and allocator types\&. .RE .PP This exchanges the elements between two sets in constant time\&. (It is only swapping a pointer, an integer, and an instance of the \fCCompare\fP type (which itself is often stateless and empty), so it should be quite fast\&.) Note that the global std::swap() function is specialized such that std::swap(s1,s2) will feed to this function\&. .PP Definition at line 387 of file stl_set\&.h\&. .PP Referenced by std::swap()\&. .SS "template, typename _Alloc = std::allocator<_Key>> \fBiterator\fP \fBstd::set\fP< _Key, _Compare, _Alloc >::upper_bound (const \fBkey_type\fP &__x)\fC [inline]\fP" .PP Finds the end of a subsequence matching given key\&. \fBParameters:\fP .RS 4 \fIx\fP Key to be located\&. .RE .PP \fBReturns:\fP .RS 4 Iterator pointing to the first element greater than key, or \fBend()\fP\&. .RE .PP .PP Definition at line 584 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> \fBconst_iterator\fP \fBstd::set\fP< _Key, _Compare, _Alloc >::upper_bound (const \fBkey_type\fP &__x) const\fC [inline]\fP" .PP Finds the end of a subsequence matching given key\&. \fBParameters:\fP .RS 4 \fIx\fP Key to be located\&. .RE .PP \fBReturns:\fP .RS 4 Iterator pointing to the first element greater than key, or \fBend()\fP\&. .RE .PP .PP Definition at line 588 of file stl_set\&.h\&. .SS "template, typename _Alloc = std::allocator<_Key>> \fBvalue_compare\fP \fBstd::set\fP< _Key, _Compare, _Alloc >::value_comp () const\fC [inline]\fP" .PP Returns the comparison object with which the set was constructed\&. .PP Definition at line 278 of file stl_set\&.h\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.