std::async returns a std::future.
Calling get()
on the future will make it wait until the result is available, then return it. So, even if it is run asynchronously, you are doing nothing but waiting for the result.
std::async
doesn't magically parallelize the for
loop in Foo::fooFunction
.