fork(1) download
  1. #include <iostream>
  2.  
  3. auto gL =
  4. [](auto&& func, auto&&... params)
  5. {
  6. return std::forward<decltype(func)>(func)(
  7. std::forward<decltype(params)>(params)...);
  8. };
  9.  
  10. int main() {
  11. gL([](const char * s){std::cout << s << '\n'; return 5;}, "foo");
  12. gL([](const char * s){std::cout << s << '\n'; return;} , "bar");
  13. }
Success #stdin #stdout 0s 3096KB
stdin
Standard input is empty
stdout
foo
bar