.TH "std::unordered_set< _Value, _Hash, _Pred, _Alloc >" 3cxx "Tue Feb 2 2021" "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::unordered_set< _Value, _Hash, _Pred, _Alloc > \- A standard container composed of unique keys (containing at most one of each key value) in which the elements' keys are the elements themselves\&. .SH SYNOPSIS .br .PP .SS "Public Types" .in +1c .ti -1c .RI "typedef _Hashtable::allocator_type \fBallocator_type\fP" .br .ti -1c .RI "typedef _Hashtable::const_iterator \fBconst_iterator\fP" .br .ti -1c .RI "typedef _Hashtable::const_local_iterator \fBconst_local_iterator\fP" .br .ti -1c .RI "typedef _Hashtable::const_pointer \fBconst_pointer\fP" .br .ti -1c .RI "typedef _Hashtable::const_reference \fBconst_reference\fP" .br .ti -1c .RI "typedef _Hashtable::difference_type \fBdifference_type\fP" .br .ti -1c .RI "typedef _Hashtable::hasher \fBhasher\fP" .br .ti -1c .RI "typedef _Hashtable::iterator \fBiterator\fP" .br .ti -1c .RI "typedef _Hashtable::key_equal \fBkey_equal\fP" .br .ti -1c .RI "typedef _Hashtable::key_type \fBkey_type\fP" .br .RI "Public typedefs\&. " .ti -1c .RI "typedef _Hashtable::local_iterator \fBlocal_iterator\fP" .br .ti -1c .RI "typedef _Hashtable::pointer \fBpointer\fP" .br .RI "Iterator-related typedefs\&. " .ti -1c .RI "typedef _Hashtable::reference \fBreference\fP" .br .ti -1c .RI "typedef _Hashtable::size_type \fBsize_type\fP" .br .ti -1c .RI "typedef _Hashtable::value_type \fBvalue_type\fP" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBunordered_set\fP ()=default" .br .RI "Default constructor\&. " .ti -1c .RI "template \fBunordered_set\fP (_InputIterator __first, _InputIterator __last, size_type __n, const allocator_type &__a)" .br .ti -1c .RI "template \fBunordered_set\fP (_InputIterator __first, _InputIterator __last, size_type __n, const hasher &__hf, const allocator_type &__a)" .br .ti -1c .RI "template \fBunordered_set\fP (_InputIterator __first, _InputIterator __last, size_type __n=0, const hasher &__hf=hasher(), const key_equal &__eql=key_equal(), const allocator_type &__a=allocator_type())" .br .RI "Builds an unordered_set from a range\&. " .ti -1c .RI "\fBunordered_set\fP (const allocator_type &__a)" .br .RI "Creates an unordered_set with no elements\&. " .ti -1c .RI "\fBunordered_set\fP (const \fBunordered_set\fP &)=default" .br .RI "Copy constructor\&. " .ti -1c .RI "\fBunordered_set\fP (const \fBunordered_set\fP &__uset, const allocator_type &__a)" .br .ti -1c .RI "\fBunordered_set\fP (\fBinitializer_list\fP< value_type > __l, size_type __n, const allocator_type &__a)" .br .ti -1c .RI "\fBunordered_set\fP (\fBinitializer_list\fP< value_type > __l, size_type __n, const hasher &__hf, const allocator_type &__a)" .br .ti -1c .RI "\fBunordered_set\fP (\fBinitializer_list\fP< value_type > __l, size_type __n=0, const hasher &__hf=hasher(), const key_equal &__eql=key_equal(), const allocator_type &__a=allocator_type())" .br .RI "Builds an unordered_set from an initializer_list\&. " .ti -1c .RI "\fBunordered_set\fP (size_type __n, const allocator_type &__a)" .br .ti -1c .RI "\fBunordered_set\fP (size_type __n, const hasher &__hf, const allocator_type &__a)" .br .ti -1c .RI "\fBunordered_set\fP (size_type __n, const hasher &__hf=hasher(), const key_equal &__eql=key_equal(), const allocator_type &__a=allocator_type())" .br .RI "Default constructor creates no elements\&. " .ti -1c .RI "\fBunordered_set\fP (\fBunordered_set\fP &&)=default" .br .RI "Move constructor\&. " .ti -1c .RI "\fBunordered_set\fP (\fBunordered_set\fP &&__uset, const allocator_type &__a)" .br .ti -1c .RI "const_iterator \fBbegin\fP () const noexcept" .br .ti -1c .RI "iterator \fBbegin\fP () noexcept" .br .ti -1c .RI "local_iterator \fBbegin\fP (size_type __n)" .br .RI "Returns a read-only (constant) iterator pointing to the first bucket element\&. " .ti -1c .RI "const_local_iterator \fBbegin\fP (size_type __n) const" .br .ti -1c .RI "size_type \fBbucket\fP (const \fBkey_type\fP &__key) const" .br .ti -1c .RI "size_type \fBbucket_count\fP () const noexcept" .br .RI "Returns the number of buckets of the unordered_set\&. " .ti -1c .RI "size_type \fBbucket_size\fP (size_type __n) const" .br .ti -1c .RI "const_iterator \fBcbegin\fP () const noexcept" .br .ti -1c .RI "const_local_iterator \fBcbegin\fP (size_type __n) const" .br .ti -1c .RI "const_iterator \fBcend\fP () const noexcept" .br .ti -1c .RI "const_local_iterator \fBcend\fP (size_type __n) const" .br .ti -1c .RI "void \fBclear\fP () noexcept" .br .ti -1c .RI "size_type \fBcount\fP (const \fBkey_type\fP &__x) const" .br .RI "Finds the number of elements\&. " .ti -1c .RI "template \fBstd::pair\fP< iterator, bool > \fBemplace\fP (_Args &&\&.\&.\&. __args)" .br .RI "Attempts to build and insert an element into the unordered_set\&. " .ti -1c .RI "template iterator \fBemplace_hint\fP (const_iterator __pos, _Args &&\&.\&.\&. __args)" .br .RI "Attempts to insert an element into the unordered_set\&. " .ti -1c .RI "bool \fBempty\fP () const noexcept" .br .RI "Returns true if the unordered_set is empty\&. " .ti -1c .RI "const_iterator \fBend\fP () const noexcept" .br .ti -1c .RI "iterator \fBend\fP () noexcept" .br .ti -1c .RI "local_iterator \fBend\fP (size_type __n)" .br .RI "Returns a read-only (constant) iterator pointing to one past the last bucket elements\&. " .ti -1c .RI "const_local_iterator \fBend\fP (size_type __n) const" .br .ti -1c .RI "\fBstd::pair\fP< iterator, iterator > \fBequal_range\fP (const \fBkey_type\fP &__x)" .br .RI "Finds a subsequence matching given key\&. " .ti -1c .RI "\fBstd::pair\fP< const_iterator, const_iterator > \fBequal_range\fP (const \fBkey_type\fP &__x) const" .br .ti -1c .RI "size_type \fBerase\fP (const \fBkey_type\fP &__x)" .br .RI "Erases elements according to the provided key\&. " .ti -1c .RI "iterator \fBerase\fP (const_iterator __first, const_iterator __last)" .br .RI "Erases a [__first,__last) range of elements from an unordered_set\&. " .ti -1c .RI "iterator \fBerase\fP (const_iterator __position)" .br .RI "Erases an element from an unordered_set\&. " .ti -1c .RI "iterator \fBerase\fP (iterator __position)" .br .ti -1c .RI "iterator \fBfind\fP (const \fBkey_type\fP &__x)" .br .RI "Tries to locate an element in an unordered_set\&. " .ti -1c .RI "const_iterator \fBfind\fP (const \fBkey_type\fP &__x) const" .br .ti -1c .RI "allocator_type \fBget_allocator\fP () const noexcept" .br .RI "Returns the allocator object used by the unordered_set\&. " .ti -1c .RI "hasher \fBhash_function\fP () const" .br .RI "Returns the hash functor object with which the unordered_set was constructed\&. " .ti -1c .RI "template void \fBinsert\fP (_InputIterator __first, _InputIterator __last)" .br .RI "A template function that attempts to insert a range of elements\&. " .ti -1c .RI "\fBstd::pair\fP< iterator, bool > \fBinsert\fP (const value_type &__x)" .br .RI "Attempts to insert an element into the unordered_set\&. " .ti -1c .RI "iterator \fBinsert\fP (const_iterator __hint, const value_type &__x)" .br .RI "Attempts to insert an element into the unordered_set\&. " .ti -1c .RI "iterator \fBinsert\fP (const_iterator __hint, value_type &&__x)" .br .ti -1c .RI "void \fBinsert\fP (\fBinitializer_list\fP< value_type > __l)" .br .RI "Attempts to insert a list of elements into the unordered_set\&. " .ti -1c .RI "\fBstd::pair\fP< iterator, bool > \fBinsert\fP (value_type &&__x)" .br .ti -1c .RI "key_equal \fBkey_eq\fP () const" .br .RI "Returns the key comparison object with which the unordered_set was constructed\&. " .ti -1c .RI "float \fBload_factor\fP () const noexcept" .br .RI "Returns the average number of elements per bucket\&. " .ti -1c .RI "size_type \fBmax_bucket_count\fP () const noexcept" .br .RI "Returns the maximum number of buckets of the unordered_set\&. " .ti -1c .RI "float \fBmax_load_factor\fP () const noexcept" .br .RI "Returns a positive number that the unordered_set tries to keep the load factor less than or equal to\&. " .ti -1c .RI "void \fBmax_load_factor\fP (float __z)" .br .RI "Change the unordered_set maximum load factor\&. " .ti -1c .RI "size_type \fBmax_size\fP () const noexcept" .br .RI "Returns the maximum size of the unordered_set\&. " .ti -1c .RI "\fBunordered_set\fP & \fBoperator=\fP (const \fBunordered_set\fP &)=default" .br .RI "Copy assignment operator\&. " .ti -1c .RI "\fBunordered_set\fP & \fBoperator=\fP (\fBinitializer_list\fP< value_type > __l)" .br .RI "Unordered_set list assignment operator\&. " .ti -1c .RI "\fBunordered_set\fP & \fBoperator=\fP (\fBunordered_set\fP &&)=default" .br .RI "Move assignment operator\&. " .ti -1c .RI "void \fBrehash\fP (size_type __n)" .br .RI "May rehash the unordered_set\&. " .ti -1c .RI "void \fBreserve\fP (size_type __n)" .br .RI "Prepare the unordered_set for a specified number of elements\&. " .ti -1c .RI "size_type \fBsize\fP () const noexcept" .br .RI "Returns the size of the unordered_set\&. " .ti -1c .RI "void \fBswap\fP (\fBunordered_set\fP &__x) noexcept(noexcept(_M_h\&.swap(__x\&._M_h)))" .br .RI "Swaps data with another unordered_set\&. " .in -1c .SS "Friends" .in +1c .ti -1c .RI "template bool \fBoperator==\fP (const \fBunordered_set\fP< _Value1, _Hash1, _Pred1, _Alloc1 > &, const \fBunordered_set\fP< _Value1, _Hash1, _Pred1, _Alloc1 > &)" .br .in -1c .SH "Detailed Description" .PP .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> .br class std::unordered_set< _Value, _Hash, _Pred, _Alloc >" A standard container composed of unique keys (containing at most one of each key value) in which the elements' keys are the elements themselves\&. .PP \fBTemplate Parameters\fP .RS 4 \fI_Value\fP Type of key objects\&. .br \fI_Hash\fP Hashing function object type, defaults to hash<_Value>\&. .br \fI_Pred\fP Predicate function object type, defaults to equal_to<_Value>\&. .br \fI_Alloc\fP Allocator type, defaults to allocator<_Key>\&. .RE .PP Meets the requirements of a \fCcontainer\fP, and \fCunordered associative container\fP .PP Base is _Hashtable, dispatched at compile time via template alias __uset_hashtable\&. .PP Definition at line 97 of file unordered_set\&.h\&. .SH "Member Typedef Documentation" .PP .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> typedef _Hashtable::key_type \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::\fBkey_type\fP" .PP Public typedefs\&. .PP Definition at line 106 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> typedef _Hashtable::pointer \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::\fBpointer\fP" .PP Iterator-related typedefs\&. .PP Definition at line 115 of file unordered_set\&.h\&. .SH "Constructor & Destructor Documentation" .PP .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::\fBunordered_set\fP ()\fC [default]\fP" .PP Default constructor\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::\fBunordered_set\fP (size_type __n, const hasher & __hf = \fChasher()\fP, const key_equal & __eql = \fCkey_equal()\fP, const allocator_type & __a = \fCallocator_type()\fP)\fC [inline]\fP, \fC [explicit]\fP" .PP Default constructor creates no elements\&. .PP \fBParameters\fP .RS 4 \fI__n\fP Minimal initial number of buckets\&. .br \fI__hf\fP A hash functor\&. .br \fI__eql\fP A key equality functor\&. .br \fI__a\fP An allocator object\&. .RE .PP .PP Definition at line 145 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> template \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::\fBunordered_set\fP (_InputIterator __first, _InputIterator __last, size_type __n = \fC0\fP, const hasher & __hf = \fChasher()\fP, const key_equal & __eql = \fCkey_equal()\fP, const allocator_type & __a = \fCallocator_type()\fP)\fC [inline]\fP" .PP Builds an unordered_set from a range\&. .PP \fBParameters\fP .RS 4 \fI__first\fP An input iterator\&. .br \fI__last\fP An input iterator\&. .br \fI__n\fP Minimal initial number of buckets\&. .br \fI__hf\fP A hash functor\&. .br \fI__eql\fP A key equality functor\&. .br \fI__a\fP An allocator object\&. .RE .PP Create an unordered_set consisting of copies of the elements from [__first,__last)\&. This is linear in N (where N is distance(__first,__last))\&. .PP Definition at line 166 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::\fBunordered_set\fP (const \fBunordered_set\fP< _Value, _Hash, _Pred, _Alloc > &)\fC [default]\fP" .PP Copy constructor\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::\fBunordered_set\fP (\fBunordered_set\fP< _Value, _Hash, _Pred, _Alloc > &&)\fC [default]\fP" .PP Move constructor\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::\fBunordered_set\fP (const allocator_type & __a)\fC [inline]\fP, \fC [explicit]\fP" .PP Creates an unordered_set with no elements\&. .PP \fBParameters\fP .RS 4 \fI__a\fP An allocator object\&. .RE .PP .PP Definition at line 185 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::\fBunordered_set\fP (\fBinitializer_list\fP< value_type > __l, size_type __n = \fC0\fP, const hasher & __hf = \fChasher()\fP, const key_equal & __eql = \fCkey_equal()\fP, const allocator_type & __a = \fCallocator_type()\fP)\fC [inline]\fP" .PP Builds an unordered_set from an initializer_list\&. .PP \fBParameters\fP .RS 4 \fI__l\fP An initializer_list\&. .br \fI__n\fP Minimal initial number of buckets\&. .br \fI__hf\fP A hash functor\&. .br \fI__eql\fP A key equality functor\&. .br \fI__a\fP An allocator object\&. .RE .PP Create an unordered_set consisting of copies of the elements in the list\&. This is linear in N (where N is \fI__l\&.size()\fP)\&. .PP Definition at line 220 of file unordered_set\&.h\&. .SH "Member Function Documentation" .PP .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> iterator \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::begin ()\fC [inline]\fP, \fC [noexcept]\fP" Returns a read-only (constant) iterator that points to the first element in the unordered_set\&. .PP Definition at line 319 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> local_iterator \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::begin (size_type __n)\fC [inline]\fP" .PP Returns a read-only (constant) iterator pointing to the first bucket element\&. .PP \fBParameters\fP .RS 4 \fI__n\fP The bucket index\&. .RE .PP \fBReturns\fP .RS 4 A read-only local iterator\&. .RE .PP .PP Definition at line 726 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> size_type \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::bucket_count () const\fC [inline]\fP, \fC [noexcept]\fP" .PP Returns the number of buckets of the unordered_set\&. .PP Definition at line 692 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> const_iterator \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::cbegin () const\fC [inline]\fP, \fC [noexcept]\fP" Returns a read-only (constant) iterator that points to the first element in the unordered_set\&. .PP Definition at line 346 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> const_iterator \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::cend () const\fC [inline]\fP, \fC [noexcept]\fP" Returns a read-only (constant) iterator that points one past the last element in the unordered_set\&. .PP Definition at line 354 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> void \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::clear ()\fC [inline]\fP, \fC [noexcept]\fP" Erases all elements in an unordered_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 572 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> size_type \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::count (const \fBkey_type\fP & __x) const\fC [inline]\fP" .PP Finds the number of elements\&. .PP \fBParameters\fP .RS 4 \fI__x\fP Element to located\&. .RE .PP \fBReturns\fP .RS 4 Number of elements with specified key\&. .RE .PP This function only makes sense for unordered_multisets; for unordered_set the result will either be 0 (not present) or 1 (present)\&. .PP Definition at line 667 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> template \fBstd::pair\fP \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::emplace (_Args &&\&.\&.\&. __args)\fC [inline]\fP" .PP Attempts to build and insert an element into the unordered_set\&. .PP \fBParameters\fP .RS 4 \fI__args\fP Arguments used to generate an element\&. .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 build and insert an element into the unordered_set\&. An unordered_set relies on unique keys and thus an element is only inserted if it is not already present in the unordered_set\&. .PP Insertion requires amortized constant time\&. .PP Definition at line 376 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> template iterator \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::emplace_hint (const_iterator __pos, _Args &&\&.\&.\&. __args)\fC [inline]\fP" .PP Attempts to insert an element into the unordered_set\&. .PP \fBParameters\fP .RS 4 \fI__pos\fP An iterator that serves as a hint as to where the element should be inserted\&. .br \fI__args\fP Arguments used to generate the element to be inserted\&. .RE .PP \fBReturns\fP .RS 4 An iterator that points to the element with key equivalent to the one generated from \fI__args\fP (may or may not be the element itself)\&. .RE .PP This function is not concerned about whether the insertion took place, and thus does not return a boolean like the single-argument emplace() 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 \fIhinting\fP, see: https://gcc.gnu.org/onlinedocs/libstdc++/manual/associative.html#containers.associative.insert_hints .PP Insertion requires amortized constant time\&. .PP Definition at line 402 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> bool \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::empty () const\fC [inline]\fP, \fC [noexcept]\fP" .PP Returns true if the unordered_set is empty\&. .PP Definition at line 298 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> iterator \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::end ()\fC [inline]\fP, \fC [noexcept]\fP" Returns a read-only (constant) iterator that points one past the last element in the unordered_set\&. .PP Definition at line 333 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> local_iterator \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::end (size_type __n)\fC [inline]\fP" .PP Returns a read-only (constant) iterator pointing to one past the last bucket elements\&. .PP \fBParameters\fP .RS 4 \fI__n\fP The bucket index\&. .RE .PP \fBReturns\fP .RS 4 A read-only local iterator\&. .RE .PP .PP Definition at line 746 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> \fBstd::pair\fP \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::equal_range (const \fBkey_type\fP & __x)\fC [inline]\fP" .PP Finds a subsequence matching given key\&. .PP \fBParameters\fP .RS 4 \fI__x\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 probably only makes sense for multisets\&. .PP Definition at line 680 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> size_type \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::erase (const \fBkey_type\fP & __x)\fC [inline]\fP" .PP Erases elements according to the provided key\&. .PP \fBParameters\fP .RS 4 \fI__x\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 an unordered_set\&. For an unordered_set the result of this function can only be 0 (not present) or 1 (present)\&. 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 544 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> iterator \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::erase (const_iterator __first, const_iterator __last)\fC [inline]\fP" .PP Erases a [__first,__last) range of elements from an unordered_set\&. .PP \fBParameters\fP .RS 4 \fI__first\fP Iterator pointing to the start of the range to be erased\&. .br \fI__last\fP Iterator pointing to the end of the range to be erased\&. .RE .PP \fBReturns\fP .RS 4 The iterator \fI__last\fP\&. .RE .PP This function erases a sequence of elements from an unordered_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 562 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> iterator \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::erase (const_iterator __position)\fC [inline]\fP" .PP Erases an element from an unordered_set\&. .PP \fBParameters\fP .RS 4 \fI__position\fP An iterator pointing to the element to be erased\&. .RE .PP \fBReturns\fP .RS 4 An iterator pointing to the element immediately following \fI__position\fP prior to the element being erased\&. If no such element exists, end() is returned\&. .RE .PP This function erases an element, pointed to by the given iterator, from an unordered_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 522 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> iterator \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::find (const \fBkey_type\fP & __x)\fC [inline]\fP" .PP Tries to locate an element in an unordered_set\&. .PP \fBParameters\fP .RS 4 \fI__x\fP Element to be located\&. .RE .PP \fBReturns\fP .RS 4 Iterator pointing to sought-after element, or end() 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 ( \fCend()\fP ) iterator\&. .PP Definition at line 649 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> allocator_type \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::get_allocator () const\fC [inline]\fP, \fC [noexcept]\fP" .PP Returns the allocator object used by the unordered_set\&. .PP Definition at line 291 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> hasher \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::hash_function () const\fC [inline]\fP" .PP Returns the hash functor object with which the unordered_set was constructed\&. .PP Definition at line 625 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> template void \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::insert (_InputIterator __first, _InputIterator __last)\fC [inline]\fP" .PP A template function that attempts to insert a range of elements\&. .PP \fBParameters\fP .RS 4 \fI__first\fP Iterator pointing to the start of the range to be inserted\&. .br \fI__last\fP Iterator pointing to the end of the range\&. .RE .PP Complexity similar to that of the range constructor\&. .PP Definition at line 468 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> \fBstd::pair\fP \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::insert (const value_type & __x)\fC [inline]\fP" .PP Attempts to insert an element into the unordered_set\&. .PP \fBParameters\fP .RS 4 \fI__x\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 unordered_set\&. An unordered_set relies on unique keys and thus an element is only inserted if it is not already present in the unordered_set\&. .PP Insertion requires amortized constant time\&. .PP Definition at line 420 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> iterator \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::insert (const_iterator __hint, const value_type & __x)\fC [inline]\fP" .PP Attempts to insert an element into the unordered_set\&. .PP \fBParameters\fP .RS 4 \fI__hint\fP An iterator that serves as a hint as to where the element should be inserted\&. .br \fI__x\fP Element to be inserted\&. .RE .PP \fBReturns\fP .RS 4 An iterator that points to the element with key of \fI__x\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 insert() 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 \fIhinting\fP, see: https://gcc.gnu.org/onlinedocs/libstdc++/manual/associative.html#containers.associative.insert_hints .PP Insertion requires amortized constant\&. .PP Definition at line 449 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> void \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::insert (\fBinitializer_list\fP< value_type > __l)\fC [inline]\fP" .PP Attempts to insert a list of elements into the unordered_set\&. .PP \fBParameters\fP .RS 4 \fI__l\fP A std::initializer_list of elements to be inserted\&. .RE .PP Complexity similar to that of the range constructor\&. .PP Definition at line 479 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> key_equal \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::key_eq () const\fC [inline]\fP" .PP Returns the key comparison object with which the unordered_set was constructed\&. .PP Definition at line 631 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> float \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::load_factor () const\fC [inline]\fP, \fC [noexcept]\fP" .PP Returns the average number of elements per bucket\&. .PP Definition at line 762 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> size_type \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::max_bucket_count () const\fC [inline]\fP, \fC [noexcept]\fP" .PP Returns the maximum number of buckets of the unordered_set\&. .PP Definition at line 697 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> float \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::max_load_factor () const\fC [inline]\fP, \fC [noexcept]\fP" .PP Returns a positive number that the unordered_set tries to keep the load factor less than or equal to\&. .PP Definition at line 768 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> void \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::max_load_factor (float __z)\fC [inline]\fP" .PP Change the unordered_set maximum load factor\&. .PP \fBParameters\fP .RS 4 \fI__z\fP The new maximum load factor\&. .RE .PP .PP Definition at line 776 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> size_type \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::max_size () const\fC [inline]\fP, \fC [noexcept]\fP" .PP Returns the maximum size of the unordered_set\&. .PP Definition at line 308 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> \fBunordered_set\fP& \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::operator= (const \fBunordered_set\fP< _Value, _Hash, _Pred, _Alloc > &)\fC [default]\fP" .PP Copy assignment operator\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> \fBunordered_set\fP& \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::operator= (\fBinitializer_list\fP< value_type > __l)\fC [inline]\fP" .PP Unordered_set list assignment operator\&. .PP \fBParameters\fP .RS 4 \fI__l\fP An initializer_list\&. .RE .PP This function fills an unordered_set with copies of the elements in the initializer list \fI__l\fP\&. .PP Note that the assignment completely changes the unordered_set and that the resulting unordered_set's size is the same as the number of elements assigned\&. .PP Definition at line 283 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> \fBunordered_set\fP& \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::operator= (\fBunordered_set\fP< _Value, _Hash, _Pred, _Alloc > &&)\fC [default]\fP" .PP Move assignment operator\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> void \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::rehash (size_type __n)\fC [inline]\fP" .PP May rehash the unordered_set\&. .PP \fBParameters\fP .RS 4 \fI__n\fP The new number of buckets\&. .RE .PP Rehash will occur only if the new number of buckets respect the unordered_set maximum load factor\&. .PP Definition at line 787 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> void \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::reserve (size_type __n)\fC [inline]\fP" .PP Prepare the unordered_set for a specified number of elements\&. .PP \fBParameters\fP .RS 4 \fI__n\fP Number of elements required\&. .RE .PP Same as rehash(ceil(n / max_load_factor()))\&. .PP Definition at line 798 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> size_type \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::size () const\fC [inline]\fP, \fC [noexcept]\fP" .PP Returns the size of the unordered_set\&. .PP Definition at line 303 of file unordered_set\&.h\&. .SS "template, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>> void \fBstd::unordered_set\fP< _Value, _Hash, _Pred, _Alloc >::swap (\fBunordered_set\fP< _Value, _Hash, _Pred, _Alloc > & __x)\fC [inline]\fP, \fC [noexcept]\fP" .PP Swaps data with another unordered_set\&. .PP \fBParameters\fP .RS 4 \fI__x\fP An unordered_set of the same element and allocator types\&. .RE .PP This exchanges the elements between two sets in constant time\&. Note that the global std::swap() function is specialized such that std::swap(s1,s2) will feed to this function\&. .PP Definition at line 585 of file unordered_set\&.h\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.