Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
for_each_argument
#include <functional> #include <iostream> using namespace std; template <typename F, typename... Args> void for_each_argument(F f, Args&&... args) { using t = int[sizeof...(Args)]; (void)t{(f(forward<Args>(args)), 0)...}; } struct print { template <typename T> void operator()(const T& x) const { cout << x << endl; } }; int main() { for_each_argument(print(), 10, "Hello", 42.5); }
run
|
edit
|
history
|
help
2
Please
log in
to post a comment.
Graphs Iteration1 Undirected.
Initialise arrays with N number
sort
std::function ambiguity clang
vector destruction - clang
is_convertible
Specialization on signed types
Enum flags operator example
Unpacking tuple
Variable declarations in while loop conditions are also C++-only.
Please log in to post a comment.