Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <future>
- int task(int param) {
- return param + 1;
- }
- int main() {
- std::future<int> f;
- f = std::async(std::launch::async, task, 4);
- f.wait();
- int result = f.get();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement