'class' : template argument 'parameter' : invalid use of local variable 'variable' as non-type argument
You cannot use the name or address of a local variable as a template argument.
The following sample generates C2971:
template <int *pi> class Y { }; int global_var = 0; void main() { int local_var = 0; Y<&local_var> aY; // C2971 // use the code below to resolve the error // Y<&global_var> aY; }