I am reading C++ Templates (2nd edition) and this is a snippet from the book:
template<typename... Ts, int N>
void f(double (&)[N+1], Ts... ps) {return;}
It is specified in the book that the declaration above is useless because N cannot be specified or deduced.
I am trying to understand why something like the following is an error:
double arr[2];
f<int, double, 1>(arr, 1, 2.0);
When I compile the snippet above, I get the error that there is no matching function for call to f.
This compiles fine
template<typename... Ts, typename T>
void func(T value){};
func(1);
even though I have an additional parameter after a parameter pack.
Why does my specifying of the template arguments explicitly not match the arguments provided? Please help me understand this.