Skip to content

Should Hashtable really be a range (that is destroyed by iteration)? #30

@n8sh

Description

@n8sh

Right now Hashtable is a range and what's more iterating over the range is destructive, which may result in surprising and undesired behavior when used with functions in std.algorithm such as find. The right design might be the Hashtable itself not to be a range but for it to expose a range view of its mappings (#14) through byKeyValue() or something similar. (This would be distinct from the existing keyValuePairs which allocates a new array and copies the mappings into it.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions