Until we switch to C++17 and can use the proper attributes there. Fixes #1437
std::hash specialization is a pain to work with, stop using that, and just specialize a 'size_t hash_value(const T&)' free function.