Date
2011-03-05.21:44:45
Message id
588

Content

Is std::hash a constrained template or not?

According to class template hash [unord.hash], the definition is:

template <class T>
struct hash : public std::unary_function<T, std::size_t> {
  std::size_t operator()(T val) const;
};

And so unconstrained.

According to the <functional> synopsis in p2 Function objects [function.objects] the template is declared as:

template <ReferentType T> struct hash;

which would make hash a constrained template.