16 Library introduction [library]

16.4 Library-wide requirements [requirements]

16.4.4 Requirements on types and expressions [utility.requirements]

16.4.4.5 Cpp17Hash requirements [hash.requirements]

Table 34: Cpp17Hash requirements [tab:cpp17.hash]
Expression
Return type
Requirement
h(k)
size_­t
The value returned shall depend only on the argument k for the duration of the program.
[Note 1:
Thus all evaluations of the expression h(k) with the same value for k yield the same result for a given execution of the program.
— end note]
For two different values t1 and t2, the probability that h(t1) and h(t2) compare equal should be very small, approaching 1.0 / numeric_­limits<size_­t>​::​max().
h(u)
size_­t
Shall not modify u.