Assume my_hasher
is a hashing function object. Should the following be correct, according to the Standard?
my_type k;
assert(my_hasher{}(k) == my_hasher{}(k));
The cppreference states the above assertion is correct.
However, the Standard (16.5.3.4, [hash.requirements]) only requires that for a specific instance of my_hasher
,
the value returned shall depend only on the argument k for the duration of the program
...which seems like it permits 2 different instances of my_hasher
to return different hash values for the same operand.
So, is cppreference mistaken or am I missing something?