Unordered associative containers (C++)
In the programming language C++, unordered associative containers are a group of class templates in the C++ Standard Library that implement hash table variants. Being templates, they can be used to store arbitrary elements, such as integers or custom classes. The following containers are defined in the current revision of the C++ standard: unordered_set
, unordered_map
, unordered_multiset
, unordered_multimap
. Each of these containers differ only on constraints placed on their elements.
C++ Standard Library |
---|
Containers |
C standard library |
The unordered associative containers are similar to the associative containers in the C++ Standard Library but have different constraints. As their name implies, the elements in the unordered associative containers are not ordered. This is due to the use of hashing to store objects. The containers can still be iterated through like a regular associative container.