Why should I use std::async?

后端 未结 5 1960
南旧
南旧 2020-12-04 08:29

I\'m trying to explore all the options of the new C++11 standard in depth, while using std::async and reading its definition, I noticed 2 things, at least under linux with g

5条回答
  •  抹茶落季
    2020-12-04 09:13

    http://www.cplusplus.com/reference/future/async/

    there are three type of policy,

    1. launch::async
    2. launch::deferred
    3. launch::async|launch::deferred

    by default launch::async|launch::deferred is passed to std::async.

提交回复
热议问题