fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <functional>
  4. using namespace std;
  5.  
  6. void quick() {
  7. cout << "quick ";
  8. }
  9. void brown() {
  10. cout << "brown ";
  11. }
  12. void fox() {
  13. cout << "fox ";
  14. }
  15.  
  16. int main() {
  17. vector<function<void()> > events;
  18. events.push_back(quick);
  19. events.push_back(brown);
  20. events.push_back(fox);
  21. for (auto f : events) {
  22. f();
  23. }
  24. return 0;
  25. }
Success #stdin #stdout 0s 3432KB
stdin
Standard input is empty
stdout
quick brown fox