fork download
  1. #include <iostream>
  2. #include <functional>
  3. using namespace std;
  4.  
  5. int main() {
  6. function<void(int)> f;
  7. f = [](const int& i) -> int { cout<<i<<endl; return i; };
  8. f(2);
  9. return 0;
  10. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
2