template<int a[4]> struct A { };
template<int f(int)> struct B { };
int i;
int g(int) { return 0;}
A<&i> x;
B<&g> y;
The type deduced from &i is int
*, and the type deduced from &g is int
(*)(int).You may qualify a non-type template parameter with const or volatile.
You cannot declare a non-type template parameter as a floating point, class, or void type.
Non-type template parameters are not lvalues.