While working with C++11 template parameter bundles, I came up with the code below:
#include <cstdio>
static void testFunc(int i1, int i2) {
printf("testFunc(%d, %d)\n", i1, i2);
}
template <size_t... Indices> void wrapper() {
testFunc(Indices...);
}
int main(int argc, char *argv[]) {
wrapper<1, 2>();
return 0;
}
An attempt to compile this with g++4.8.2 resulted in a
"too few arguments to function ‘void testFunc(int, int)’"
error.
Is this no valid C++ or does g++ just not yet implement this kind of non-type template parameter bundle usage?
It's valid and this appears to be a bug in gcc's variadic templates implementation. I searched a bit on the gcc bugzilla page and did not find any reports of this issue.