fork download
  1. #include <iostream>
  2. #include <chrono>
  3. #include <future>
  4.  
  5. using namespace std;
  6.  
  7. void sample(void)
  8. {
  9. cout << "sample" << endl;
  10. }
  11.  
  12. int main()
  13. {
  14. auto f = async(sample);
  15. f.get();
  16.  
  17. return 0;
  18. }
  19.  
Runtime error #stdin #stdout #stderr 0s 3040KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
terminate called after throwing an instance of 'std::system_error'
  what():  Unknown error 4294967295