Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- #include <vector>
- #include <algorithm>
- typedef void (*func)();
- void Func1()
- {
- std::puts("Func1() called.");
- }
- void Func2()
- {
- std::puts("Func2() called.");
- }
- int main()
- {
- std::vector<func> funcs = {Func1, Func2};
- auto funcRun = [] (func f) { (*f)(); };
- for_each(funcs.begin(), funcs.end(), funcRun);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement