Сабж. Единственное что у меня вышло, это
int p[sizeof ... (args)] = {args ...};
А вот рекурсивный проход
#include<stdio.h>
void g(){}
template <int x, int ... args> void g(){
printf("%i\n", x);
g<args...>();
}
int main(){
g<1,2,3>();
return 0;
}
$ g++ -Wall -std=c++0x test.cpp
test.cpp: In function ‘void g() [with int x = 3, int ...args = ]’:
test.cpp:7: instantiated from ‘void g() [with int x = 2, int ...args = 3]’
test.cpp:7: instantiated from ‘void g() [with int x = 1, int ...args = 2, 3]’
test.cpp:11: instantiated from here
test.cpp:7: error: no matching function for call to ‘g()’