Files
concurrency-in-action/source/listing_4.6.cpp
2018-10-18 00:40:34 -05:00

21 lines
305 B
C++

#include <future>
#include <iostream>
int
find_the_answer_to_ltuae()
{
return 42;
}
void
do_other_stuff()
{
}
int
main()
{
std::future<int> the_answer = std::async(find_the_answer_to_ltuae);
do_other_stuff();
std::cout << "The answer is " << the_answer.get() << std::endl;
}