Description
Motivation
The hashmap in the stdlib does not provide a way to retrieve all keys in the map. As shown in the Prior Art section, a way to retrieve all keys in a hashmap is required in other programming languages, and it would significantly expands the use of the hashmap.
Prior Art
The Map in Java has the SetKey()
method that returns the keys in this map.
The list()
function for Python's dict
returns a list of all the keys used in the dictionary.
The unordered_map
in C++ does not have a similar method, but a way to get all the keys is required. (for example, see https://stackoverflow.com/questions/8483985/obtaining-list-of-keys-and-values-from-unordered-map)
Additional Information
The hashmaps in the stdlib, including open_hash_map_type
and chaining_hash_map_type
, store both the entered keys and values to the component inverse
. So it is not challenging work to retrieve the keys as a key_type
array.
The conversion from the key_type
to the original type is left to the users.