Std::unordered_map with enum

/usr/include/c++/5/bits/hashtable_policy.h:85:11: error: implicit instantiation of undefined template 'std::hash<EProc>' noexcept(declval<const _Hash&>()(declval<const _Key&>()))>

This error means that the compiler does not know how to hash an EProc. Keys in the unordered_map must be hashable types. See e.g. this stackoverflow thread.

By the way, it seems that the fact that compilers didn’t just fall back to the hashing function for the underlying type was considered a C++ standard defect, was fixed, and recent compilers seem to be ok with it: https://godbolt.org/z/aYqgGN

What ROOT version are you using? ROOT 6.20 does not seem to have a problem with this code:

enum class EProc {kPAIR = 0, kCOMP, kPHOT, kPFIS, kDRAY, kANNI, kBREM, kHADR, kMUNU, kDCAY, kLOSS, kMULS, kCKOV, kLABS, kRAYL};
const static std::unordered_map<EProc, const char*> mProcessIDToName;

Cheers,
Enrico