fork download
  1. #include <functional>
  2. #include <iostream>
  3.  
  4. template <typename ...ARGS>
  5. std::function<void(ARGS...)> wrapper(std::function<void(ARGS...)> f){
  6. return [f](ARGS... arg){
  7. f(arg...);
  8. };
  9. }
  10.  
  11.  
  12. int main()
  13. {
  14. std::function <void(int,int,char)> f = [](int a ,int b ,char c ) -> void { std::cout << "111"; };
  15. auto t = wrapper(f);
  16. t(1,2,3);
  17. return 0;
  18. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
111