unordered map


declaration

    
template<
    class Key,
    class T,
    class Hash = std::hash<key>,
    class KeyEqual = std::equal_to<key>,
    class Allocator = std::allocator<std::pair<const>>
> class unordered_map;
    
Key is the type of the keys
T is the type of the mapped values
Hash is the hash function object
KeyEqual is the equality comparison function
Allocator is the allocator used to manage memory

member types

Member type Definition Explanation
key_type Key Type of the keys.
mapped_type T Type of the mapped values.
value_type std::pair<const>Key, T> Type of elements stored in the container.
hasher Hash The hash function type.
key_equal KeyEqual The equality comparison function type.
allocator_type Allocator Allocator type.
size_type Unsigned integer type (usually std::size_t) Used for sizes and indices.
difference_type Signed integer type (usually std::ptrdiff_t) Used for differences between iterators.
reference value_type& Reference to an element, allows modification.
const_reference const value_type& Const reference to an element, read-only access.
iterator Iterator to value_type Traverses and modifies elements.
const_iterator Const iterator to value_type Traverses elements without modification.

member functions

element access

iterators

capacity

modifiers