C++ concepts: Hash

From cppreference.com

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.

It must satisfy the requirements of CopyConstructible and Destructible.

Even if passed a lvalue, the Hash object must not modify the input.

Several calls with the same input shall return the same output.

The probability of h(a)==h(b) for a!=b should approach 1.0/std::numeric_limits<size_t>::max().


Hash::operator()


std::size_t operator() ( const Key& k )



[edit] Standard library

std::hash