From Cppreference
|
|
|
|
|
template< class T > class promise;
|
(1)
|
(C++11 feature)
|
|
|
template< class T > class promise<T&>;
|
(2)
|
(C++11 feature)
|
|
|
template<> class promise<void>;
|
(3)
|
(C++11 feature)
|
|
|
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.
[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