Skip to content

Instantly share code, notes, and snippets.

@caetanus
Created November 24, 2013 16:58
Show Gist options
  • Select an option

  • Save caetanus/7629419 to your computer and use it in GitHub Desktop.

Select an option

Save caetanus/7629419 to your computer and use it in GitHub Desktop.
a variadic study case for cpp
#include <iostream>
using namespace std;
template<class Single>
void printItout(Single arg)
{
cout << arg << "\n";
}
template<class First, class... Others>
void printItout(First first, Others... others)
{
cout << first << ", ";
printItout(others...);
}
int main()
{
printItout(30,40, "oi", 0.4, "bar", 'u');
cout << "printItout(30,40, \"oi\", 0.4, \"bar\", 'u');\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment