2 ms·
Every object is hashable. Here's a hash function that works with anything: int hash(Object anything) { return 3; } Most objects permit more effective hash
by munificent 8y ago
Every object is hashable. Here's a hash function that works with anything:
int hash(Object anything) { return 3; }
Most objects permit more effective hash functions with better distribution properties than that.
In practice, I think more types are hashable than are comparable.