Advertisement
Guest User

Untitled

a guest
Mar 20th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. #include <future>
  2.  
  3. int task(int param) {
  4. return param + 1;
  5. }
  6.  
  7. int main() {
  8. std::future<int> f;
  9. f = std::async(std::launch::async, task, 4);
  10. f.wait();
  11. int result = f.get();
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement