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.)
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.algorithmsuch asfind. 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) throughbyKeyValue()or something similar. (This would be distinct from the existingkeyValuePairswhich allocates a new array and copies the mappings into it.)