fork download
  1. #include <iostream>
  2. #include <boost/function.hpp>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. boost::function<double(double, double)> fn = [](double x, double y) -> double
  8. {
  9. return x + y;
  10. };
  11.  
  12. std::cout << fn(1.0, 2.0) << std::endl;
  13. return 0;
  14. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
3