I think type definition is not allowed.
14.6.1 Locally Declared Names (N4296)
6 The template parameter should not be redesigned within its scope (including nested areas). The template parameter must not have the same name as the template name. [Example:
template <class T, int i> class Y {
int T; // error: template-parameter redeclared
void f() {
char T; // error: template-parameter redeclared
}
};
template<class X> class X; // error: template-parameter redeclared
- ]
typedef EnumType EnumType - typedef-name.