#include <iostream>
using namespace std;
//停止解析參數列表
void function()
{
}
template <typename T, typename... U>
void function(T t, U... args)
{
//解析包的大小
cout << "the numbers of args is " << sizeof...(U) + 1 << ends;
//cout << "the size of args is " << sizeof...(args) + 1 << ends;
cout << t << endl;
function(args...);
}
int main()
{
function("123", "456", "789", "10 11", "12 13");
system("pause");
}
//結果
//the numbers of args is 5 123
//the numbers of args is 4 456
//the numbers of args is 3 789
//the numbers of args is 2 10 11
//the numbers of args is 1 12 13
//請按任意鍵繼續. . .