Namespaces
Variants
Views
Actions

std::promise

From cppreference.com
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.

Contents

[edit] Member functions

constructs the promise object
(public member function) [edit]
destructs the promise object
(public member function) [edit]
assigns the shared state
(public member function) [edit]
swaps two promise objects
(public member function) [edit]
Getting the result
returns a future associated with the promised result
(public member function) [edit]
Setting the result
sets the result to specific value
(public member function) [edit]
sets the result to specific value while delivering the notification only at thread exit
(public member function) [edit]
sets the result to indicate an exception
(public member function) [edit]
sets the result to indicate an exception while delivering the notification only at thread exit
(public member function) [edit]

[edit] Non-member functions

specializes the std::swap algorithm
(function template) [edit]

[edit] Helper classes

specializes the std::uses_allocator type trait
(class template specialization) [edit]