C++ named requirements: Hash (since C++11)
A Hash is a function object for which the output depends only on the input and has a very low probability of yielding the same output given different input values.
T satisfies Hash if
- h, a value of type
const T, whose argument type is
- k, a value of type convertible to
Keyor const Key,
- u, an lvalue expression of type
The following expressions must be valid and have their specified effects.
|The returned value depends only on the value of k for the duration of the program.
All evaluations of h(k) executed within a given execution of a program yield the same result for the same value of k.
|u is not modified.
 Standard library
| hash function object
 Defect reports
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
|Behavior as published
|same results for same arguments were required in all cases
|only required within a single execution