Standard library implements std::hash as a template struct that is specialized for different types. It is used like this:
#include
#include
A template function can not be partially specialized for types, while std::hash specialized for different types as a class template.
And, in this template class based way, you can do some meta programming such as accessing to return type and key type like below:
std::hash::argument_type
std::hash::result_type