The below code works fine :
template<typename T, int n>
class Fib {};
template<typename T,int n>
class Fib<T*,n> {};
But the below code shows error as:
Error : template parameters not deducible in partial specialization:
template<typename T, int n>
class Fib {};
template<typename T,int n>
class Fib<T*,0> {};
Can you explain the reason for this behaviour ?
I believe you are just missing the right syntax for the partial specialization:
template<typename T, int n>
class Fib {
};
template<typename T>
class Fib<T*,0> {
};
The first parameter on the template is type, while the second is just a constant value.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With