hash_map and hash_multimap define a host of nested types similar to standard containers. Several noteworthy points:
typedef value_type argument_type; typedef size_type result_type;
This qualifies it as a std::unary_function (as defined in <functional>) and so could be used where other functionals are used.
size_type operator()(const value_type& x) const; size_type operator()(const key_type& x) const;
These simply return the result of key_hasher, but with the first operator extracting the key_type from the value_type before passing the key_type on to key_hasher.
typedef value_type first_argument_type; typedef value_type second_argument_type; typedef bool result_type;
This qualifies it as a std:: binary_function (as defined in <functional>) and so could be used where other functionals are used.
bool operator()(const value_type& x, const value_type& y) const; bool operator()(const key_type& x, const value_type& y) const; bool operator()(const value_type& x, const key_type& y) const;
These pass their arguments on to key_compare, extracting the key_type from value_type when necessary.