3 ms·
There's nothing stopping you writing your own hash map that can be configured with a custom hash function. The builtin map is limited to types for which the la
by dsymonds 14y ago
There's nothing stopping you writing your own hash map that can be configured with a custom hash function.
The builtin map is limited to types for which the language defines ==. It's a simplifying trade-off; I don't think "acceptable" versus "unacceptable" enters into it. One could imagine expanding the builtin map type to support a hash function, and that was something that was considered early on, but it added complexity that just wasn't needed most of the time.