fork download
  1. #include <iostream>
  2. #include <functional>
  3. using namespace std;
  4.  
  5. void print(int (*value)(void)) {
  6. cout << value() << endl;
  7. }
  8.  
  9. int main() {
  10. auto f = [] () {
  11. return 4;
  12. };
  13. print(f);
  14. return 0;
  15. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
4