std::experi...amentalsTS)(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸŽ€ 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:

  1. Default constructor. Constructs the promise with an empty shared state.
  2. 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).
  3. Move constructor. Constructs the promise with the shared state of other using move semantics. After construction, other has no shared state.
  4. std::experimental::promise is 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 of std::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 type std::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), where A is the type of alloc. The pointer remains valid only for the lifetime of the promise object.
  • None of the above β†’ The program is ill-formed.

🌸 Parameters 🌸

  • alloc β€” allocator to use to allocate the shared state
  • other β€” another std::experimental::promise to 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