定义于头文件
<future>
|
||
enum class launch : /* unspecified */ {
async = /* unspecified */, |
(C++11 起) | |
指定 std::async 所指定的任务的的运行策略。 std::launch
是用作位掩码类型 (BitmaskType
) 的枚举。
标准库定义下列代表单独位的常量:
常量 | 解释 |
std::launch::async
|
运行新线程,以异步执行任务 |
std::launch::deferred
|
调用方线程上首次请求其结果时执行任务(惰性求值) |
另外,允许实现:
(C++11)
|
异步运行函数(有可能在新线程中)并返回保有结果的 std::future (函数模板) |