Suppose A is some class and I have the following function template with a nontype argument:
template <typename T, int v> void func(const T& x);
Now I wish to have different implementations for different types T e.g. I want to have a general version of func for general types (general means types that do not have a special version of func designed for it) and a special version of func for class A which is different from the general version. Also, the users of this design call func in the following way:
func<int,9>(11);
func<A,1>(a); //a is an object of class A
My question is, given that function templates are not allowed to be partially specialized and overloading func would not allow users to call it in the way of func<A,1>, how am I able to correctly implement func?