Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int sa2a(int n)
- {
- assert(n > 0);
- int nn = (n / 100) + 99-(n % 100);
- if (nn == 0)
- nn = 1;
- return f1(nn, 4);
- }
- thread t0(sa2a, 10);
- auto future = std::async(std::launch::async, &sa2a, 10);
- // do some other stuff
- int result = future.get(); // wait on async completion and get result
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement