首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::launch

Defined in header <future>

?

?

enum class launch : /* unspecified */ { async = /* unspecified */, deferred = /* unspecified */, /* implementation-defined */ };

?

(since C++11)

对象执行的任务的启动策略。std::async功能。std::launch是用作BitmaskType...

标准库定义了表示单个位的下列常量:

Constant

Explanation

std::launch::async

a new thread is launched to execute the task asynchronously

std::launch::deferred

the task is executed on the calling thread the first time its result is requested (lazy evaluation)

此外,还允许实现:

  • 定义额外的位位和位掩码,以指定适用于启动策略子集的任务交互的限制,以及
  • 为第一个%28默认%29重载启用这些额外的位掩码。std::async...

另见

async (C++11)

runs a function asynchronously (potentially in a new thread) and returns a std::future that will hold the result (function template)

代码语言:txt
复制
 ? cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com