|
|
Defined in header <future> | ||
enumclass launch:/* unspecified */{ async= /* unspecified */, | (since C++11) | |
std::launch
is aBitmaskType. It specifies the launch policy for a task executed by thestd::async function.
The following constants denoting individual bits are defined by the standard library:
Enumerator | Meaning |
async | the task is executed on a different thread, potentially by creating and launching it first |
deferred | the task is executed on the calling thread the first time its result is requested (lazy evaluation) |
In addition, implementations are allowed to:
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
DR | Applied to | Behavior as published | Correct behavior |
---|---|---|---|
LWG 2102 | C++11 | std::launch was an implementation-defined type | it is not implementation-defined |
(C++11) | runs a function asynchronously (potentially in a new thread) and returns astd::future that will hold the result (function template)[edit] |