i've read that scoped template specalization is allowed in C++17
clang supports it starting with release 7 MSVC supports it with VS2017(i don't know what revision) Intel does not like it https://gcc.godbolt.org/z/1GET6v ------ enumclass E{ A, B }; struct Ta{ int x; }; struct Tb{ float y; }; struct Mapper { template<typename Type> struct type_to_enum{}; template<> // <-- FAILS struct type_to_enum<Ta> { staticconstexprauto value = E::A; }; template <> // <-- Fails struct type_to_enum<Tb> { staticconstexprauto value = E::B; }; }; -------