Run Code
|
API
|
Code Wall
|
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
New wall
ljblblljkl
C++ Register
problem_name_4
regimeketopdfb
Segment Tree Impl
Namespace scope qualifier
GetTypeName
Example of custom deleter to manage a resource.
lref assignment