fork download
  1. #include <iostream>
  2. #include <functional>
  3.  
  4. int main(int argc, const char* argv[]) {
  5. std::function<void(int)> function = [] (int x) { std::cout << x << std::endl; };
  6. auto binding = std::bind(function, 10);
  7. std::function<void()> jobFunctor = binding;
  8.  
  9. jobFunctor();
  10. }
Success #stdin #stdout 0s 3476KB
stdin
Standard input is empty
stdout
10