std::promise<R>::promise
From cppreference.com
C++
Feature test macros (C++20)
Concepts library (C++20)
Metaprogramming library (C++11)
Ranges library (C++20)
Filesystem library (C++17)
Concurrency support library (C++11)
Execution control library (C++26)
Concurrency support library
(C++11)
(C++20)
(C++11)
(C++11)
(C++20)
(C++26)
(C++26)
(C++20)
(C++26)
(C++20)
(C++26)
(C++26)
(C++26)
(C++26)
(C++26)
(C++26)
(C++11)
(C++11)
(C++17)
(C++11)
(C++14)
(C++11)
(C++11)
(C++11)
(C++11)(C++11)(C++11)(C++11)(C++11)(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++20)(C++20)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++26)
(C++26)
(C++26)
(C++11)
(C++20)
(C++11)
(C++11)(deprecated in C++20)
(C++11)(deprecated in C++20)
(C++11)
(C++11)
(C++11)(deprecated in C++26)
(C++11)
(C++11)
(C++11)(C++11)
(C++11)(C++11)
(C++11)(C++11)
(C++11)(C++11)
(C++11)(C++11)
(C++11)(C++11)
(C++11)(C++11)
(C++11)(C++11)
(C++26)(C++26)
(C++26)(C++26)
(C++11)
(C++20)(C++20)
(C++20)
(C++20)
(C++11)(C++11)
(C++11)(C++11)
(C++20)(C++20)
(C++20)(C++20)
(C++20)
(C++20)
std::promise
Member functions
promise::promise
Getting the result
Setting the result
Non-member Functions
Helper Classes
promise();
(1)
(since C++11)
template< class Alloc >
promise( std::allocator_arg_t, const Alloc& 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.
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.
Alloc
must meet the requirements of Allocator.3) Move constructor. Constructs the promise with the shared state of other using move semantics. After construction, other has no shared state.
4)
promise
is not copyable.[edit] Parameters
alloc
-
allocator to use to allocate the shared state
other
-
another
promise
to acquire the state from
[edit] Exceptions
1,2) May throw implementation-defined exceptions.
[edit] Example
This section is incomplete
Reason: no example
Reason: no example