This is an internal header file, included by other library headers. More...
Functions | |
namespace std | _GLIBCXX_VISIBILITY (default) |
This is an internal header file, included by other library headers.
Do not attempt to use it directly. {unordered_set}
namespace std _GLIBCXX_VISIBILITY | ( | default | ) |
Base types for unordered_set.
Base types for unordered_multiset.
A standard container composed of unique keys (containing at most one of each key value) in which the elements' keys are the elements themselves.
_Value | Type of key objects. |
_Hash | Hashing function object type, defaults to hash<_Value>. |
_Pred | Predicate function object type, defaults to equal_to<_Value>. |
_Alloc | Allocator type, defaults to allocator<_Key>. |
Meets the requirements of a container, and unordered associative container
Base is _Hashtable, dispatched at compile time via template alias __uset_hashtable.
Public typedefs.
Iterator-related typedefs.
Default constructor.
Default constructor creates no elements.
__n | Minimal initial number of buckets. |
__hf | A hash functor. |
__eql | A key equality functor. |
__a | An allocator object. |
Builds an unordered_set from a range.
__first | An input iterator. |
__last | An input iterator. |
__n | Minimal initial number of buckets. |
__hf | A hash functor. |
__eql | A key equality functor. |
__a | An allocator object. |
Create an unordered_set consisting of copies of the elements from [__first,__last). This is linear in N (where N is distance(__first,__last)).
Copy constructor.
Move constructor.
Creates an unordered_set with no elements.
__a | An allocator object. |
Builds an unordered_set from an initializer_list.
__l | An initializer_list. |
__n | Minimal initial number of buckets. |
__hf | A hash functor. |
__eql | A key equality functor. |
__a | An allocator object. |
Create an unordered_set consisting of copies of the elements in the list. This is linear in N (where N is __l.size()).
Copy assignment operator.
Move assignment operator.
Unordered_set list assignment operator.
__l | An initializer_list. |
This function fills an unordered_set with copies of the elements in the initializer list __l.
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. Old data may be lost.
Returns the allocator object with which the unordered_set was constructed.
Returns true if the unordered_set is empty.
Returns the size of the unordered_set.
Returns the maximum size of the unordered_set.
Returns a read-only (constant) iterator that points to the first element in the unordered_set.
Returns a read-only (constant) iterator that points one past the last element in the unordered_set.
Returns a read-only (constant) iterator that points to the first element in the unordered_set.
Returns a read-only (constant) iterator that points one past the last element in the unordered_set.
Attempts to build and insert an element into the unordered_set.
__args | Arguments used to generate an element. |
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.
Insertion requires amortized constant time.
Attempts to insert an element into the unordered_set.
__pos | An iterator that serves as a hint as to where the element should be inserted. |
__args | Arguments used to generate the element to be inserted. |
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.
For more on hinting, see: https://gcc.gnu.org/onlinedocs/libstdc++/manual/associative.html#containers.associative.insert_hints
Insertion requires amortized constant time.
Attempts to insert an element into the unordered_set.
__x | Element to be inserted. |
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.
Insertion requires amortized constant time.
Attempts to insert an element into the unordered_set.
__hint | An iterator that serves as a hint as to where the element should be inserted. |
__x | Element to be inserted. |
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.
For more on hinting, see: https://gcc.gnu.org/onlinedocs/libstdc++/manual/associative.html#containers.associative.insert_hints
Insertion requires amortized constant.
A template function that attempts to insert a range of elements.
__first | Iterator pointing to the start of the range to be inserted. |
__last | Iterator pointing to the end of the range. |
Complexity similar to that of the range constructor.
Attempts to insert a list of elements into the unordered_set.
__l | A std::initializer_list<value_type> of elements to be inserted. |
Complexity similar to that of the range constructor.
Erases an element from an unordered_set.
__position | An iterator pointing to the element to be erased. |
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.
Erases elements according to the provided key.
__x | Key of element to be erased. |
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.
Erases a [__first,__last) range of elements from an unordered_set.
__first | Iterator pointing to the start of the range to be erased. |
__last | Iterator pointing to the end of the range to be erased. |
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.
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.
Swaps data with another unordered_set.
__x | An unordered_set of the same element and allocator types. |
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.
Returns the hash functor object with which the unordered_set was constructed.
Returns the key comparison object with which the unordered_set was constructed.
Tries to locate an element in an unordered_set.
__x | Element to be located. |
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 ( end()
) iterator.
Finds the number of elements.
__x | Element to located. |
This function only makes sense for unordered_multisets; for unordered_set the result will either be 0 (not present) or 1 (present).
Finds a subsequence matching given key.
__x | Key to be located. |
This function probably only makes sense for multisets.
Returns the number of buckets of the unordered_set.
Returns the maximum number of buckets of the unordered_set.
Returns a read-only (constant) iterator pointing to the first bucket element.
__n | The bucket index. |
Returns a read-only (constant) iterator pointing to one past the last bucket elements.
__n | The bucket index. |
Returns the average number of elements per bucket.
Returns a positive number that the unordered_set tries to keep the load factor less than or equal to.
Change the unordered_set maximum load factor.
__z | The new maximum load factor. |
May rehash the unordered_set.
__n | The new number of buckets. |
Rehash will occur only if the new number of buckets respect the unordered_set maximum load factor.
Prepare the unordered_set for a specified number of elements.
__n | Number of elements required. |
Same as rehash(ceil(n / max_load_factor())).
A standard container composed of equivalent keys (possibly containing multiple of each key value) in which the elements' keys are the elements themselves.
_Value | Type of key objects. |
_Hash | Hashing function object type, defaults to hash<_Value>. |
_Pred | Predicate function object type, defaults to equal_to<_Value>. |
_Alloc | Allocator type, defaults to allocator<_Key>. |
Meets the requirements of a container, and unordered associative container
Base is _Hashtable, dispatched at compile time via template alias __umset_hashtable.
Public typedefs.
Iterator-related typedefs.
Default constructor.
Default constructor creates no elements.
__n | Minimal initial number of buckets. |
__hf | A hash functor. |
__eql | A key equality functor. |
__a | An allocator object. |
Builds an unordered_multiset from a range.
__first | An input iterator. |
__last | An input iterator. |
__n | Minimal initial number of buckets. |
__hf | A hash functor. |
__eql | A key equality functor. |
__a | An allocator object. |
Create an unordered_multiset consisting of copies of the elements from [__first,__last). This is linear in N (where N is distance(__first,__last)).
Copy constructor.
Move constructor.
Builds an unordered_multiset from an initializer_list.
__l | An initializer_list. |
__n | Minimal initial number of buckets. |
__hf | A hash functor. |
__eql | A key equality functor. |
__a | An allocator object. |
Create an unordered_multiset consisting of copies of the elements in the list. This is linear in N (where N is __l.size()).
Copy assignment operator.
Move assignment operator.
Creates an unordered_multiset with no elements.
__a | An allocator object. |
Unordered_multiset list assignment operator.
__l | An initializer_list. |
This function fills an unordered_multiset with copies of the elements in the initializer list __l.
Note that the assignment completely changes the unordered_multiset and that the resulting unordered_multiset's size is the same as the number of elements assigned. Old data may be lost.
Returns the allocator object with which the unordered_multiset was constructed.
Returns true if the unordered_multiset is empty.
Returns the size of the unordered_multiset.
Returns the maximum size of the unordered_multiset.
Returns a read-only (constant) iterator that points to the first element in the unordered_multiset.
Returns a read-only (constant) iterator that points one past the last element in the unordered_multiset.
Returns a read-only (constant) iterator that points to the first element in the unordered_multiset.
Returns a read-only (constant) iterator that points one past the last element in the unordered_multiset.
Builds and insert an element into the unordered_multiset.
__args | Arguments used to generate an element. |
Insertion requires amortized constant time.
Inserts an element into the unordered_multiset.
__pos | An iterator that serves as a hint as to where the element should be inserted. |
__args | Arguments used to generate the element to be inserted. |
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.
For more on hinting, see: https://gcc.gnu.org/onlinedocs/libstdc++/manual/associative.html#containers.associative.insert_hints
Insertion requires amortized constant time.
Inserts an element into the unordered_multiset.
__x | Element to be inserted. |
Insertion requires amortized constant time.
Inserts an element into the unordered_multiset.
__hint | An iterator that serves as a hint as to where the element should be inserted. |
__x | Element to be inserted. |
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.
For more on hinting, see: https://gcc.gnu.org/onlinedocs/libstdc++/manual/associative.html#containers.associative.insert_hints
Insertion requires amortized constant.
A template function that inserts a range of elements.
__first | Iterator pointing to the start of the range to be inserted. |
__last | Iterator pointing to the end of the range. |
Complexity similar to that of the range constructor.
Inserts a list of elements into the unordered_multiset.
__l | A std::initializer_list<value_type> of elements to be inserted. |
Complexity similar to that of the range constructor.
Erases an element from an unordered_multiset.
__position | An iterator pointing to the element to be erased. |
This function erases an element, pointed to by the given iterator, from an unordered_multiset.
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.
Erases elements according to the provided key.
__x | Key of element to be erased. |
This function erases all the elements located by the given key from an unordered_multiset.
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.
Erases a [__first,__last) range of elements from an unordered_multiset.
__first | Iterator pointing to the start of the range to be erased. |
__last | Iterator pointing to the end of the range to be erased. |
This function erases a sequence of elements from an unordered_multiset.
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.
Erases all elements in an unordered_multiset.
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.
Swaps data with another unordered_multiset.
__x | An unordered_multiset of the same element and allocator types. |
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.
Returns the hash functor object with which the unordered_multiset was constructed.
Returns the key comparison object with which the unordered_multiset was constructed.
Tries to locate an element in an unordered_multiset.
__x | Element to be located. |
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 ( end()
) iterator.
Finds the number of elements.
__x | Element to located. |
Finds a subsequence matching given key.
__x | Key to be located. |
Returns the number of buckets of the unordered_multiset.
Returns the maximum number of buckets of the unordered_multiset.
Returns a read-only (constant) iterator pointing to the first bucket element.
__n | The bucket index. |
Returns a read-only (constant) iterator pointing to one past the last bucket elements.
__n | The bucket index. |
Returns the average number of elements per bucket.
Returns a positive number that the unordered_multiset tries to keep the load factor less than or equal to.
Change the unordered_multiset maximum load factor.
__z | The new maximum load factor. |
May rehash the unordered_multiset.
__n | The new number of buckets. |
Rehash will occur only if the new number of buckets respect the unordered_multiset maximum load factor.
Prepare the unordered_multiset for a specified number of elements.
__n | Number of elements required. |
Same as rehash(ceil(n / max_load_factor())).
References std::__exception_ptr::operator!=(), std::__exception_ptr::operator==(), and std::__exception_ptr::swap().