std::experi...amentalsTS)(3)
π NAME π
bestie, this is the std::experi...amentalsTS)(3) page from the C++ Standard Libary manual (yes, the header literally spells it βLibaryβ like that π). Itβs the page for std::experimental::promise::promise(libraryfundamentalsTS) β and also std::experimental::promise::promise(libraryfundamentalsTS), because the NAME line says it twice, periodt.
β¨ Synopsis β¨
promise(); (1) (library
fundamentals TS)
template< class Alloc > (2) (library
fundamentals TS)
promise( std::allocator_arg_t, const Alloc& alloc );
promise( promise&& other ) noexcept; (3) (library
fundamentals TS)
promise( const promise& other ) = delete; (4) (library
fundamentals TS)
π Description π
Constructs a std::experimental::promise object. Hereβs the constructor tea, no cap:
- Default constructor. Constructs the promise with an empty shared state.
- Constructs the promise with an empty shared state. The shared state is allocated using
alloc, which is treated as a type-erased allocator (see below). - Move constructor. Constructs the promise with the shared state of
otherusing move semantics. After construction,otherhas no shared state. std::experimental::promiseis not copyable.
π§ Type-erased allocator π§
The constructors of promise that take an allocator argument alloc treat that argument as a type-erased allocator. The memory resource pointer used by promise to allocate memory is determined using the allocator argument (if specified) as follows β hereβs the mapping from the type of alloc to the value of the memory resource pointer:
- Non-existent (no allocator specified at time of construction) β the value of
std::experimental::pmr::get_default_resource()at time of construction. std::nullptr_tβ the value ofstd::experimental::pmr::get_default_resource()at time of construction.- A pointer type convertible to
std::experimental::pmr::memory_resource*βstatic_cast<std::experimental::pmr::memory_resource*>(alloc) std::experimental::pmr::memory_resource*βalloc(a pointer to a value of typestd::experimental::pmr::memory_resource)- A specialization of
std::experimental::pmr::polymorphic_allocatorβalloc.resource() - Any other type meeting the Allocator requirements β
std::experimental::pmr::resource_adaptor<A>(alloc), whereAis the type ofalloc. The pointer remains valid only for the lifetime of thepromiseobject. - None of the above β The program is ill-formed.
πΈ Parameters πΈ
allocβ allocator to use to allocate the shared stateotherβ anotherstd::experimental::promiseto acquire the state from
π Exceptions π
1,2)(none)
okay thatβs the whole page, bestie π«Ά source/version: http://cppreference.com, 2024.06.10, and the title was std::experi...amentalsTS)(3). slay β¨
π¦ 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