Created
January 18, 2023 14:51
-
-
Save qwertyowmx/bbd81708a37980e1373fac88775ca594 to your computer and use it in GitHub Desktop.
C++ fold print 1
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> | |
template <const char sep = ' ', typename ... Args> | |
void println(Args ... args) { | |
((std::cout << args << sep), ...); | |
} | |
int main() | |
{ | |
println<'_'>(1, 2, 3, 4, 5); | |
println(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment