Last active
August 29, 2015 13:57
-
-
Save sguzman/9543414 to your computer and use it in GitHub Desktop.
Printing anything using variadic templates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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