SFINAE only works for substituted template parameters, not any complication
error (or it would be called CEINAE); therefore hash<T> for enums will fail
to compile, given a non-enum, rather than being ignored.
It's not possible to specialize hash<> for enums, since the primary template
does not have en extra Enable template argument for use with enable_if. We
therefore rename it to enum_hash<> and require users to explicitly define
hash<MyEnum> as inheriting from it.
This patchs adds a header file, "core/enum.hh"; Code which includes
this header file will be able to use an enumerated type as the key in a
hash table.
The header file implements a hash function for *all* enumerated types,
by using the standard hash function of the underlying integer type.