fork download
  1. #include <future>
  2. #include <iostream>
  3.  
  4. int foo(unsigned a, unsigned b)
  5. {
  6. return 5;
  7. }
  8.  
  9. int main()
  10. {
  11. std::future<int> f = std::async(foo, 5, 7);
  12. std::cout << f.get();
  13. }
  14.  
Runtime error #stdin #stdout 0s 2976KB
stdin
Standard input is empty
stdout
Standard output is empty