16 Oct
2021
16 Oct
'21
11:58 p.m.
Howard Hinnant wrote:
Given two values x and y, if x == y, it is convenient for hash(x) == hash(y).
In this situation, given a floating point value r, complex{r) == r, so it makes sense that hash(complex{r}) == hash(r). This might enable heterogeneous hash table lookup.
But that already doesn't hold in general for int/long, float/double, int/double, and so on.