Why does this work?
char __nontype[] = "foo"; typedef TemplateClass<T, __nontype> MyClass;
But is this (with a constant variable) not?
const char __nontype[] = "foo"; typedef TemplateClass<T, __nontype> MyClass;
Compiler Error:
error: '__nontype cannot appear in constant expression
error: template argument 2 is not valid
ejoerns
source share