Created
April 5, 2014 08:37
-
-
Save mryoshio/9989115 to your computer and use it in GitHub Desktop.
variadic template sample
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
void f() {} // do nothing | |
template<typename T, typename... Tail> | |
void f(T head, Tail... tail) | |
{ | |
g(head); // headに対し何かする | |
f(tail...); // 再度tailに対し実行 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
C++ 5.6