std::experimental::promise(libraryfundamentalsTS) (3) - Linux Manuals

std::experimental::promise(libraryfundamentalsTS): std::experimental::promise(libraryfundamentalsTS)

NAME

std::experimental::promise(libraryfundamentalsTS) - std::experimental::promise(libraryfundamentalsTS)

Synopsis


Defined in header <experimental/future>
template< class R > class promise; (1) (library fundamentals TS)
template< class R > class promise<R&>; (2) (library fundamentals TS)
template<> class promise<void>; (3) (library fundamentals TS)


std::experimental::fundamentals_v1::promise (and std::experimental::fundamentals_v2::promise) is a modified version of std::promise provided by the library fundamentals TS with support for type-erased allocators.

Member types


Member type Definition
allocator_type std::experimental::erased_type

Member functions


                    constructs the promise object
constructor (public member function)
                    retrieves a pointer to the memory resource used by this object to allocate memory
get_memory_resource (public member function)


Non-member function


                                                    specializes the swap algorithm
std::experimental::swap(std::experimental::promise) (function template)

Helper classes


                                                specializes the std::uses_allocator type trait
std::uses_allocator<std::experimental::promise> (class template specialization)


Members identical to std::promise

Member functions


                             destructs the promise object
destructor (public member function of std::promise<R>)
                             assigns the shared state
operator= (public member function of std::promise<R>)
                             swaps two promise objects
swap (public member function of std::promise<R>)

Getting the result


                             returns a future associated with the promised result
get_future (public member function of std::promise<R>)

Setting the result


                             sets the result to specific value
set_value (public member function of std::promise<R>)
                             sets the result to specific value while delivering the notification only at thread exit
set_value_at_thread_exit (public member function of std::promise<R>)
                             sets the result to indicate an exception
set_exception (public member function of std::promise<R>)
                             sets the result to indicate an exception while delivering the notification only at thread exit
set_exception_at_thread_exit (public member function of std::promise<R>)