std::async launch::deferred

does it launches the function with seperate thread and joins it as with launch::async ?
No. It won't run the function until you explicitly call get() or wait() on the future. There is no point in spawning a separate thread for this so it normally just runs it in the same thread.
To add to the above answer, the future object returned from calls to std::async will block in its destructor. Thus, if you call async and don't assign the returned future to a value, it will be as if you had just called a regular function.
That seems to only be the case when std::launch::async is used.
Topic archived. No new replies allowed.