#include <iostream>
#include <string>
template <typename T, typename... Args>
void foo(const T &t, const Args& ... rest)
{
std::cout << sizeof...(Args) << std::endl;
std::cout << sizeof...(rest) << std::endl;
}
template <typename T>
std::ostream &print(std::ostream &os, const T &t)
{
return os << t;
}
template <typename T, typename... Args>
std::ostream &print(std::ostream &os, const T &t, const Args&... rest)
{
os << t << " ";
return print(os, rest...);
}
int main()
{
int i = 0; double d = 3.14;
std::string s = "how row brown cow";
foo(i, s, 42, d);
foo(s, 42, "hi");
foo(d, s);
foo("hi");
print(std::cout, i, s, 42);
std::cout << "\n";
return 0;
}