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_map}
namespace std _GLIBCXX_VISIBILITY | ( | default | ) |
Base types for unordered_map.
Base types for unordered_multimap.
A standard container composed of unique keys (containing at most one of each key value) that associates values of another type with the keys.
_Key | Type of key objects. |
_Tp | Type of mapped 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 std::allocator<std::pair<const _Key, _Tp>>. |
Meets the requirements of a container, and unordered associative container
The resulting value type of the container is std::pair<const _Key, _Tp>.
Base is _Hashtable, dispatched at compile time via template alias __umap_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_map 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_map 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_map with no elements.
__a | An allocator object. |
Builds an unordered_map 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_map 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_map list assignment operator.
__l | An initializer_list. |
This function fills an unordered_map with copies of the elements in the initializer list __l.
Note that the assignment completely changes the unordered_map and that the resulting unordered_map's size is the same as the number of elements assigned. Old data may be lost.
Returns the allocator object with which the unordered_map was constructed.
Returns true if the unordered_map is empty.
Returns the size of the unordered_map.
Returns the maximum size of the unordered_map.
Returns a read/write iterator that points to the first element in the unordered_map.
Returns a read-only (constant) iterator that points to the first element in the unordered_map.
Returns a read/write iterator that points one past the last element in the unordered_map.
Returns a read-only (constant) iterator that points one past the last element in the unordered_map.
Attempts to build and insert a std::pair into the unordered_map.
__args | Arguments used to generate a new pair instance (see std::piecewise_contruct for passing arguments to each part of the pair constructor). |
This function attempts to build and insert a (key, value) pair into the unordered_map. An unordered_map relies on unique keys and thus a pair is only inserted if its first element (the key) is not already present in the unordered_map.
Insertion requires amortized constant time.
Attempts to build and insert a std::pair into the unordered_map.
__pos | An iterator that serves as a hint as to where the pair should be inserted. |
__args | Arguments used to generate a new pair instance (see std::piecewise_contruct for passing arguments to each part of the pair constructor). |
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.
See https://gcc.gnu.org/onlinedocs/libstdc++/manual/associative.html#containers.associative.insert_hints for more on hinting.
Insertion requires amortized constant time.
Attempts to insert a std::pair into the unordered_map.
__x | Pair to be inserted (see std::make_pair for easy creation of pairs). |
This function attempts to insert a (key, value) pair into the unordered_map. An unordered_map relies on unique keys and thus a pair is only inserted if its first element (the key) is not already present in the unordered_map.
Insertion requires amortized constant time.
Attempts to insert a std::pair into the unordered_map.
__hint | An iterator that serves as a hint as to where the pair should be inserted. |
__x | Pair to be inserted (see std::make_pair for easy creation of pairs). |
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.
See https://gcc.gnu.org/onlinedocs/libstdc++/manual/associative.html#containers.associative.insert_hints for more on hinting.
Insertion requires amortized constant time.
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_map.
__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_map.
__position | An iterator pointing to the element to be erased. |
This function erases an element, pointed to by the given iterator, from an unordered_map. 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_map. For an unordered_map 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_map.
__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_map. Note that this function only erases the elements, 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_map. 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_map.
__x | An unordered_map of the same element and allocator types. |
This exchanges the elements between two unordered_map in constant time. Note that the global std::swap() function is specialized such that std::swap(m1,m2) will feed to this function.
Returns the hash functor object with which the unordered_map was constructed.
Returns the key comparison object with which the unordered_map was constructed.
Tries to locate an element in an unordered_map.
__x | Key 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 | Key to count. |
This function only makes sense for unordered_multimap; for unordered_map 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 unordered_multimap.
Subscript ( [] ) access to unordered_map data.
__k | The key for which data should be retrieved. |
Allows for easy lookup with the subscript ( [] )operator. Returns data associated with the key specified in subscript. If the key does not exist, a pair with that key is created using default values, which is then returned.
Lookup requires constant time.
Access to unordered_map data.
__k | The key for which data should be retrieved. |
std::out_of_range | If no such data is present. |
Returns the number of buckets of the unordered_map.
Returns the maximum number of buckets of the unordered_map.
Returns a read/write iterator pointing to the first bucket element.
__n | The bucket index. |
Returns a read-only (constant) iterator pointing to the first bucket element.
__n | The bucket index. |
Returns a read/write iterator pointing to one past the last bucket elements.
__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_map tries to keep the load factor less than or equal to.
Change the unordered_map maximum load factor.
__z | The new maximum load factor. |
May rehash the unordered_map.
__n | The new number of buckets. |
Rehash will occur only if the new number of buckets respect the unordered_map maximum load factor.
Prepare the unordered_map 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) that associates values of another type with the keys.
_Key | Type of key objects. |
_Tp | Type of mapped 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 std::allocator<std::pair<const _Key, _Tp>>. |
Meets the requirements of a container, and unordered associative container
The resulting value type of the container is std::pair<const _Key, _Tp>.
Base is _Hashtable, dispatched at compile time via template alias __ummap_hashtable.
Public typedefs.
Iterator-related typedefs.
Default constructor.
Default constructor creates no elements.
__n | Mnimal initial number of buckets. |
__hf | A hash functor. |
__eql | A key equality functor. |
__a | An allocator object. |
Builds an unordered_multimap 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_multimap 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_multimap with no elements.
__a | An allocator object. |
Builds an unordered_multimap 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_multimap 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_multimap list assignment operator.
__l | An initializer_list. |
This function fills an unordered_multimap with copies of the elements in the initializer list __l.
Note that the assignment completely changes the unordered_multimap and that the resulting unordered_multimap's size is the same as the number of elements assigned. Old data may be lost.
Returns the allocator object with which the unordered_multimap was constructed.
Returns true if the unordered_multimap is empty.
Returns the size of the unordered_multimap.
Returns the maximum size of the unordered_multimap.
Returns a read/write iterator that points to the first element in the unordered_multimap.
Returns a read-only (constant) iterator that points to the first element in the unordered_multimap.
Returns a read/write iterator that points one past the last element in the unordered_multimap.
Returns a read-only (constant) iterator that points one past the last element in the unordered_multimap.
Attempts to build and insert a std::pair into the unordered_multimap.
__args | Arguments used to generate a new pair instance (see std::piecewise_contruct for passing arguments to each part of the pair constructor). |
This function attempts to build and insert a (key, value) pair into the unordered_multimap.
Insertion requires amortized constant time.
Attempts to build and insert a std::pair into the unordered_multimap.
__pos | An iterator that serves as a hint as to where the pair should be inserted. |
__args | Arguments used to generate a new pair instance (see std::piecewise_contruct for passing arguments to each part of the pair constructor). |
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.
See https://gcc.gnu.org/onlinedocs/libstdc++/manual/associative.html#containers.associative.insert_hints for more on hinting.
Insertion requires amortized constant time.
Inserts a std::pair into the unordered_multimap.
__x | Pair to be inserted (see std::make_pair for easy creation of pairs). |
Insertion requires amortized constant time.
Inserts a std::pair into the unordered_multimap.
__hint | An iterator that serves as a hint as to where the pair should be inserted. |
__x | Pair to be inserted (see std::make_pair for easy creation of pairs). |
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.
See https://gcc.gnu.org/onlinedocs/libstdc++/manual/associative.html#containers.associative.insert_hints for more on hinting.
Insertion requires amortized constant time.
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_multimap.
__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_multimap.
__position | An iterator pointing to the element to be erased. |
This function erases an element, pointed to by the given iterator, from an unordered_multimap. 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 elements to be erased. |
This function erases all the elements located by the given key from an unordered_multimap. 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_multimap.
__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_multimap. Note that this function only erases the elements, 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_multimap. 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_multimap.
__x | An unordered_multimap of the same element and allocator types. |
This exchanges the elements between two unordered_multimap in constant time. Note that the global std::swap() function is specialized such that std::swap(m1,m2) will feed to this function.
Returns the hash functor object with which the unordered_multimap was constructed.
Returns the key comparison object with which the unordered_multimap was constructed.
Tries to locate an element in an unordered_multimap.
__x | Key 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 | Key to count. |
Finds a subsequence matching given key.
__x | Key to be located. |
Returns the number of buckets of the unordered_multimap.
Returns the maximum number of buckets of the unordered_multimap.
Returns a read/write iterator pointing to the first bucket element.
__n | The bucket index. |
Returns a read-only (constant) iterator pointing to the first bucket element.
__n | The bucket index. |
Returns a read/write iterator pointing to one past the last bucket elements.
__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_multimap tries to keep the load factor less than or equal to.
Change the unordered_multimap maximum load factor.
__z | The new maximum load factor. |
May rehash the unordered_multimap.
__n | The new number of buckets. |
Rehash will occur only if the new number of buckets respect the unordered_multimap maximum load factor.
Prepare the unordered_multimap 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().