[#bsl-hash_map] = xref:bsl.adoc[bsl]::hash_map :relfileprefix: ../ :mrdocs: Legacy STLPort hash container mapping unique keys to values. == Synopsis Declared in `<bslstp_hashmap.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class _Key, class _Tp, class _HashFcn = BloombergLP::bslstp::HashSelector<_Key>::Type, class _EqualKey = bsl::ComparatorSelector<_Key>::Type, class _Alloc = xref:bsl/allocator-0df.adoc[bsl::allocator<pair<_Key const, _Tp>>]> class hash_map; ---- == Type Aliases [cols="1,4"] |=== | Name| Description | xref:bsl/hash_map/_value_type.adoc[`_value_type`] | Internal synonym for the element `pair` type. | xref:bsl/hash_map/allocator_type.adoc[`allocator_type`] | Allocator type used by this map. | xref:bsl/hash_map/const_iterator.adoc[`const_iterator`] | Iterator providing non‐modifiable access to elements. | xref:bsl/hash_map/const_pointer.adoc[`const_pointer`] | Pointer to a non‐modifiable element. | xref:bsl/hash_map/const_reference.adoc[`const_reference`] | Reference to a non‐modifiable element. | xref:bsl/hash_map/data_type.adoc[`data_type`] | Mapped value type (synonym for `mapped_type`). | xref:bsl/hash_map/difference_type.adoc[`difference_type`] | Signed integral type used for iterator distances. | xref:bsl/hash_map/hasher.adoc[`hasher`] | Hash functor type. | xref:bsl/hash_map/iterator.adoc[`iterator`] | Iterator providing modifiable access to elements. | xref:bsl/hash_map/key_equal.adoc[`key_equal`] | Key‐equality functor type. | xref:bsl/hash_map/key_type.adoc[`key_type`] | Key type used by this container. | xref:bsl/hash_map/mapped_type.adoc[`mapped_type`] | Type of the mapped value associated with each key. | xref:bsl/hash_map/pointer.adoc[`pointer`] | Pointer to a modifiable element. | xref:bsl/hash_map/reference.adoc[`reference`] | Reference to a modifiable element. | xref:bsl/hash_map/size_type.adoc[`size_type`] | Unsigned integral type used for sizes. | xref:bsl/hash_map/value_type.adoc[`value_type`] | Element type stored in the map (`pair<const key, mapped>`). |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:bsl/hash_map/2constructor-0e5.adoc[`hash_map`] [.small]#[constructor]# | Constructors | xref:bsl/hash_map/begin-04.adoc[`begin`] | `begin` overloads | xref:bsl/hash_map/bucket_count.adoc[`bucket_count`] | Return the number of buckets in this container. | xref:bsl/hash_map/clear.adoc[`clear`] | Remove all elements from this map. | xref:bsl/hash_map/count.adoc[`count`] | Return the number of elements matching the specified key. | xref:bsl/hash_map/elems_in_bucket.adoc[`elems_in_bucket`] | Return the number of elements in the specified bucket. | xref:bsl/hash_map/empty.adoc[`empty`] | Return `true` if this map contains no elements. | xref:bsl/hash_map/end-02.adoc[`end`] | `end` overloads | xref:bsl/hash_map/equal_range-0b3b.adoc[`equal_range`] | `equal_range` overloads | xref:bsl/hash_map/erase-0a.adoc[`erase`] | `erase` overloads | xref:bsl/hash_map/find-0c.adoc[`find`] | `find` overloads | xref:bsl/hash_map/get_allocator.adoc[`get_allocator`] | Return the allocator used by this map. | xref:bsl/hash_map/hash_funct.adoc[`hash_funct`] | Return the hash functor used by this map. | xref:bsl/hash_map/insert-0c.adoc[`insert`] | `insert` overloads | xref:bsl/hash_map/insert_noresize.adoc[`insert_noresize`] | Insert `__obj` without resizing the bucket vector if the key is new. | xref:bsl/hash_map/key_eq.adoc[`key_eq`] | Return the key‐equality functor used by this map. | xref:bsl/hash_map/max_bucket_count.adoc[`max_bucket_count`] | Return the maximum number of buckets this container can use. | xref:bsl/hash_map/max_size.adoc[`max_size`] | Return an upper bound on the number of elements this map can hold. | xref:bsl/hash_map/operator_subs.adoc[`operator[]`] | Return a reference to the mapped value for `__key`, inserting a default‐constructed value if the key is absent. | xref:bsl/hash_map/resize.adoc[`resize`] | Rebuild the bucket vector using a size suggested by the specified hint. | xref:bsl/hash_map/size.adoc[`size`] | Return the number of elements in this map. | xref:bsl/hash_map/swap.adoc[`swap`] | Exchange the contents of this map with those of the specified map. |=== == Static Member Functions [cols="1,4"] |=== | Name| Description | xref:bsl/hash_map/_M_equal.adoc[`_M_equal`] | Return `true` if the specified maps contain the same elements. |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:bsl/operator_not_eq-0f.adoc[`operator!=`] | Return `true` if the specified hash maps do not contain the same elements. | xref:bsl/operator_eq-08d.adoc[`operator==`] | Return `true` if the specified hash maps contain the same elements. | xref:bsl/swap-030.adoc[`swap`] | Exchange the contents of the specified hash maps. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#