std::future::future(3)
π NAME π
std::future::future β std::future::future β¨ (yes bestie, the name section is literally the name twice, and honestly? iconic).
This page is from the C++ Standard Libary manual, section 3. We're talking constructors today, so grab your emotional support compiler π.
β¨ Synopsis β¨
Exact synopsis, no edits, fr fr:
future() noexcept; (1) (since C++11)
future( future&& other ) noexcept; (2) (since C++11)
future( const future& other ) = delete; (3) (since C++11)
Constructs a std::future object. That's the whole assignment: construct the future, slay π
.
(1)β Default constructor. Constructs astd::futurewith no shared state. After construction,valid() == false. So it's valid-adjacent? No bestie, it's literallyfalseβ it's a future with no shared-state tea yet π«.(2)β Move constructor. Constructs astd::futurewith the shared state ofotherusing move semantics. After construction,other.valid() == false. The shared state has been moved out ofother, andotheris left invalid π¨.(3)βstd::futureis not CopyConstructible. It's= delete, so copying is not the move, bestie β do not attempt π.
πΈ Parameters πΈ
otherβ anotherstd::futureto acquire shared state from. That's the only parameter, and it's giving "hand over the shared state" energy π«Ά.
Source/version: http://cppreference.com Β· date: 2024.06.10 Β· page: std::future::future(3) β mwah, bestie πβ¨
π¦ 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