However, nothing stops one from providing a specialization of
std::hash<std::valarray<> >. You could look at hash<std::string> ro
hash<const char*> as a starting point.
That's not true, it's undefined behaviour to specialize templates from
namespace std unless the specialization depends on one or more
user-defined types, so it is not allowed to specialize
std::hash<std::valarray<long>>. The alternative is to define your own
hash function (not a specialization of std::hash) and use that with
the unordered container.