I want my class to receive a non-type template argument but I don't want to specify the type of the non-type argument. I can do this by writing:
template<class Type, Type param>
class A
{};
It can then be used as follows:
A<int,3> a;
This is redundant because once I know that param = 3
then I know that Type = int
. Is there any way of writing this so that all of the following lines compile and instantiate different types?
A<3> a;
A<3.0> b;
A<3.0f> c;