language: C++11 (gcc-4.7.2)
date: 343 days 6 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <array>
#include <iostream>
 
template <typename ...ArgsT>
void foobar (ArgsT ...a) {
    std::array<int, sizeof... (ArgsT)> args {a...};
    std::cout << "{";
    for (auto i : args) std::cout << i;
    std::cout << "}\n";
}
 
int main () {
    foobar ();
    foobar (1, 2, 3);
}
prog.cpp: In function 'void foobar(ArgsT ...)':
prog.cpp:8:17: error: expected initializer before ':' token
prog.cpp:10:1: error: expected primary-expression before '}' token
prog.cpp:10:1: error: expected ')' before '}' token
prog.cpp:10:1: error: expected primary-expression before '}' token
prog.cpp:10:1: error: expected ';' before '}' token