#include <iostream>
template<typename Value>
void printf2(Value v)
{
std::cout<<"stop"<<std::endl;
std::cout<<v<<std::endl;
}
template<typename T, typename... Args>
void printf2(T t, Args... args)
{
std::cout<<t<<std::endl;
printf2(args...);
}
void test1()
{
printf2(1, 2, 3, 4, 5, "hello");
}
template<typename T, typename... Args>
void printf3(T t, Args... args)
{
std::cout<<t<<std::endl;
if constexpr(sizeof...(args) > 0)
{
printf3(args...);
}
}
void test2()
{
printf3(6,5,4,3,2,1,"hello");
}
template<typename ... T>
auto sum(T ... t)
{
return (t + ...);
}
void test3()
{
std::cout << sum(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) << std::endl;
}
int main()
{
test1();
test2();
test3();
return 0;
}