Skip to content

Adding a procedure getting all keys in the hashmaps #732

Closed
@degawa

Description

@degawa

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ideaProposition of an idea and opening an issue to discuss it

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions