std::promise::promise(3)
πΈ NAME πΈ
okay so welcome to std::promise::promise(3), bestie β this lives in the C++ Standard Libary manual, and the name is std::promise::promise : std::promise::promise. Yes, the icon is self-titled, we love that for her πβ¨
β¨ Synopsis β¨
Here's the constructor lineup, and code is sacred so it stays exactly like this:
promise(); (1) (since
C++11)
template< class Alloc > (2) (since
C++11)
promise( std::allocator_arg_t, const Alloc& alloc );
promise( promise&& other ) noexcept; (3) (since
C++11)
promise( const promise& other ) = delete; (4) (since
C++11)
Constructs a promise object. Main character energy from the jump π
(1)β Default constructor. Constructs thepromisewith an empty shared state. Clean slate vibes β¨(2)β Constructs thepromisewith an empty shared state. The shared state is allocated usingalloc.Allocmust meet the requirements ofAllocator. Fancy allocator moment, no cap π(3)β Move constructor. Constructs thepromisewith the shared state ofotherusing move semantics. After construction,otherhas no shared state. She took the state and left, periodt π¦(4)βpromiseis not copyable. Literally= delete, bestie π
π Parameters π
allocβ allocator to use to allocate the shared state.otherβ anotherpromiseto acquire the state from.
π¨ Exceptions π¨
1,2)β May throw implementation-defined exceptions. So, like, stay aware π
π Example π
This section is incomplete Reason: no example
Not me wanting an example and getting this ππ
π Category π
- Todo no example
okay bye bestie, go construct responsibly π shoutout to http://cppreference.com for the source/version, dated 2024.06.10 π«Ά
π¦ 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