i've read that scoped template specalization is allowed in C++17 - is it planned for the next gcc release?
otherwise i will switch to an if constexpr solution - but would be still to have this feature checked compiler: gcc trunk (and latest intel) do not support it clang (starting with release 7) and MSVC (starting with VS2017(i don't know the exact revision)) supports it ------ enum class E{ A }; struct Ta{ int x; }; struct Mapper { template<typename Type> struct type_to_enum{}; template<> // <-- FAILS struct type_to_enum<Ta> { static constexpr auto value = E::A; }; };