I have a class like this:
template <class T>
class Foo;
I want to have a specialization of
template <>
class Foo < size_t N >;
but that doesn’t compiles for me:
my main is like:
Foo<int> p; // OK
Foo<15> p2; // fails to compile
What am I missing?
You can’t – your template takes one type parameter, always. Specializations can only be more special than that, but not different (hence the name).
Maybe you can use an auxiliary template to store value information:
Usage: