fork(1) download
  1. #include <functional>
  2. #include <iostream>
  3.  
  4. std::function<void(int)> wrapper(std::function<void(int)> f){
  5. return [f](int arg){
  6. f(arg);
  7. };
  8. }
  9.  
  10. void print_n(int n){
  11. std::cout << n << std::endl;
  12. }
  13.  
  14. int main()
  15. {
  16. wrapper(print_n)(10);
  17. return 0;
  18. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
10