std::launch(3)
π NAME π
okay bestie, this is std::launch(3) from the C++ Standard Libary β and the NAME line is literally std::launch - std::launch. No cap, thatβs the whole vibe π
.
π¦ Synopsis π¦
Itβs defined in the header <future>, and hereβs the synopsis exactly as the page shows it:
Defined in header <future>
enum class launch : /* unspecified */ {
async = /* unspecified */,
deferred = /* unspecified */, (since C++11)
/* implementation-defined */
};
std::launch is a BitmaskType. It specifies the launch policy for a task executed by the std::async function.
The following constants denoting individual bits are defined by the standard library:
std::launch::asyncβ the task is executed on a different thread, potentially by creating and launching it first.std::launch::deferredβ the task is executed on the calling thread the first time its result is requested (lazy evaluation).
In addition, implementations are allowed to:
- define additional bits and bitmasks to specify restrictions on task interactions applicable to a subset of launch policies, and
- enable those additional bitmasks for the first (default) overload of
std::async.
π Defect reports π
The following behavior-changing defect reports were applied retroactively to previously published C++ standards:
- DR
LWG 2102β applied toC++11; behavior as published:std::launchwas an implementation-defined type; correct behavior: it is not implementation-defined.
π«Ά See also π«Ά
async(C++11) β runs a function asynchronously (potentially in a new thread) and returns astd::futurethat will hold the result (function template).
xoxo bestie π source: http://cppreference.com β’ version/date: 2024.06.10 β’ page: std::launch(3) β¨π«Ά
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms