std::promise
From Cppreference
| C++ Standard Library | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Thread support library | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| std::promise | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Defined in header <future>
|
||
| template< class T > class promise;
|
(1) | (since C++11) |
| template< class T > class promise<T&>;
|
(2) | (since C++11) |
| template<> class promise<void>;
|
(3) | (since C++11) |
The class template std::promise provides a facility to store a value that is later acquired asynchronously via a std::future object, that the std::promise can supply.
| This section is incomplete |
Contents |
[edit] Member functions
| constructs the promise object (public member function) |
|
| destructs the promise object (public member function) |
|
| moves the promise object (public member function) |
|
| swaps two promise objects (public member function) |
|
Getting the result | |
| returns a future associated with the promised result (public member function) |
|
Setting the result | |
| sets the result to specific value (public member function) |
|
| sets the result to specific value while delivering the notification only at thread exit (public member function) |
|
| sets the result to indicate an exception (public member function) |
|
| sets the result to indicate an exception while delivering the notification only at thread exit (public member function) |
|
[edit] Non-member functions
| This section is incomplete |
[edit] Helper classes
| specializes the std::uses_allocator type trait (class template specialization) |
|