fork download
  1. #include <iostream>
  2. #include <functional>
  3. using namespace std;
  4.  
  5. int main(){
  6. function<int(void)> f = [](){
  7. int some_variable = 10;
  8. // do some calculation
  9. return some_variable;
  10. };
  11. cout<<f();
  12. }
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
10