Why doesn't the following compile:
template <int...is> void g() {}
template <typename...Ts> void f(Ts...ts) {
g<ts...>();
}
int main() {
f(1,2);
}
it fails with
error: no matching function for call to 'g<ts#0, ts#1>()'
| g<ts...>();
| ~~~~~~~~^~
I understand that in general this is not possible since f
can be called with anything.
I am curious if there is a way to make this work in cases such as here where the compiler clearly sees the compile time constant arguments in the call to f
?