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.
The type T
satisfies Hash
if.
T
satisfies FunctionObject
, CopyConstructible
, Destructible
, and Given.
h
, a value of type T
or const T
, whose argument type is Key
k
, a value of type convertible to Key
or const Key
u
, an lvalue expression of type Key
The following expressions must be valid and have their specified effects.
Expression | Return type | Requirements |
---|---|---|
h(k) | std::size_t | the returned value depends only on the value of k for the duration of the program (since C++14) All evaluations of The probability of |
h(u) | std::size_t | u is not modified |
std::hash |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
http://en.cppreference.com/w/cpp/concept/Hash