are there any restrictions / problems using an enum as template (type) argument in C++?
Example:
enum MyEnum
{
A, B, C, D, E
};
template
Yes, there are restrictions. For example, you cannot use an anonymous enum as a template argument according to C++03 14.3.1[temp.arg.type]/2
A local type, a type with no linkage, an unnamed type or a type compounded from any of these types shall not be used as a template-argument for a template type-parameter.
So the following code is not valid in C++03:
template
void f(T) {}
enum {A};
int main() {
f(A);
}
It is valid in C++11 though.