std::launch
来自cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| Defined in header <future>
|
||
| enum class launch : /* unspecified */ { async = /* unspecified */, |
(C++11 起) | |
。指定std::async功能执行的任务的启动策略。
std::launch是一个BitmaskType(枚举,整数或bitset的).Original:
Specifies the launch policy for a task executed by the std::async function.
std::launch is a BitmaskType (enumeration, integer, or bitset).The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
。表示的各个位的定义有以下常量由标准库。
Original:
The following constants denoting individual bits are defined by the standard library:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
| 。常数。
Original: Constant The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Explanation |
std::launch::async
|
。启动一个新的线程异步执行的任务。
Original: a new thread is launched to execute the task asynchronously The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
std::launch::deferred
|
。
在调用线程的第一次请求其结果(懒惰的评估)执行任务。
Original: the task is executed on the calling thread the first time its result is requested (lazy evaluation) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
。此外,允许实现:。
Original:
In addition, implementations are allowed to:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
- 。定义指定适用于发射政策的一个子集对任务的相互作用的限制的额外的位和位掩码。Original:define additional bits and bitmasks to specify restrictions on task interactions applicable to a subset of launch policies, andThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - 。使这些额外的位掩码第一个(默认)过载std::async.Original:enable those additional bitmasks for the first (default) overload of std::async.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
[编辑] 。另请参阅。
| (C++11) |
异步运行的功能(可能在一个新的线程),并返回一个std::future,将持有的结果 Original: runs a function asynchronously (potentially in a new thread) and returns a std::future that will hold the result The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (函数模板) |