fork(2) download
  1. #include <future>
  2. #include <iostream>
  3.  
  4. int main() {
  5. std::cout << "doing the test" << std::endl;
  6. std::promise<bool> mypromise;
  7. std::future<bool> myfuture = mypromise.get_future();
  8. mypromise.set_value(true);
  9. bool result = myfuture.get();
  10. std::cout << "success, result is " << result << std::endl;
  11. return 0;
  12. }
Runtime error #stdin #stdout 0s 2992KB
stdin
Standard input is empty
stdout
doing the test