fork download
  1. #include <functional>
  2.  
  3. template<typename F>
  4. void foo(int i,F f) {
  5. f(i);
  6. }
  7.  
  8. // [](auto x) { ++x; }
  9. struct lambda {
  10. template<typename T>
  11. void operator() (T x) { ++x; }
  12. };
  13.  
  14. int main() {
  15. foo(1, lambda());
  16. }
  17.  
Success #stdin #stdout 0s 2824KB
stdin
Standard input is empty
stdout

Standard output is empty