Skip to content

Instantly share code, notes, and snippets.

@sguzman
Last active August 29, 2015 13:57
Show Gist options
  • Save sguzman/9543414 to your computer and use it in GitHub Desktop.
Save sguzman/9543414 to your computer and use it in GitHub Desktop.
Printing anything using variadic templates
#include <iostream>
static inline void print (void)
{}
template <typename Head, typename... Tail>
static inline void print (Head h, Tail... t)
{
std::cout << h << std::endl;
print(t...);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment