#include <iostream>
#include <type_traits>

template <int Arg>
void foo()
{
	std::cout << Arg << ' ';
}

template <int First, int... Rest, typename T = std::enable_if_t<(sizeof...(Rest) > 0)>>
void foo()
{
	std::cout << First << ' ';
	foo<Rest...>();
}

int main()
{
	foo<1, 2, 3>();

	return 0;
}