Код: Выделить всё
template
void foo(Ts... ts){
...
}
Код: Выделить всё
foo(1,2,'3')
Код: Выделить всё
foo(1,2,'3')
Код: Выделить всё
template
std::array foo(Ts... ts)
{
constexpr int n = sizeof...(ts);
std::array out;
return out;
}
int main()
{
auto a = foo(1, 2, 3, '4', 5);
return 0;
}
Подробнее здесь: https://stackoverflow.com/questions/787 ... meter-pack
Мобильная версия