fork(1) download
  1. #include <iostream>
  2.  
  3. template<typename F, typename... Args>
  4. auto foo( F && f, Args && ... args)
  5. {
  6. return std::forward<F>(f)(std::forward<Args>(args)...);
  7. }
  8.  
  9. int main()
  10. {
  11. foo([](int x, float y)
  12. {
  13. std::cout << x << " " << y << std::endl;
  14. },
  15. 5, 42.42f
  16. );
  17. return 0;
  18. }
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
5 42.42