template<> for the explicit specialization of a member enumeration

Viewed 152

According to 17.7.3 [temp.expl.spec] paragraph 5 (N4659),

... Members of an explicitly specialized class template are defined in the same manner as members of normal classes, and not using the template<> syntax. The same is true when defining a member of an explicitly specialized member class. However, template<> is used in defining a member of an explicitly specialized member class template that is specialized as a class template.

The explicit specialization of E definitely does not belong to the bold case, and it still needs template<>. Why is that?

template<class T> struct A {
    enum E : T;
};

template<> enum A<int>::E : int { eint };
1 Answers
Related