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
CS1428 SI Tuesday
pointer to complete array does not convert implicitly to pointer to array of unknown bound
Reference example
Specialization on signed types
std::99 bottles of beer!
Wrapper to pass shared_ptr to &, const &, *, const * through std::bind.
insertion sort
mpi_distributed_sort
Alloc
enum operator