Namespaces
Variants
Views
Actions

std::promise

From cppreference.com
< cpp‎ | thread
Revision as of 20:18, 2 November 2012 by P12bot (Talk | contribs)

Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <future>
</td>

<td></td> <td></td> <tr class="t-dcl ">

<td >
template< class T > class promise;
</td>

<td > (1) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

<td >
template< class T > class promise<T&>;
</td>

<td > (2) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

<td >
template<>          class promise<void>;
</td>

<td > (3) </td> <td > (since C++11) </td> </tr> Template:ddcl list end

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

Member functions

Template:cpp/thread/promise/dcl list constructorTemplate:cpp/thread/promise/dcl list destructorTemplate:cpp/thread/promise/dcl list operator=Template:cpp/thread/promise/dcl list swapTemplate:cpp/thread/promise/dcl list get futureTemplate:cpp/thread/promise/dcl list set valueTemplate:cpp/thread/promise/dcl list set value at thread exitTemplate:cpp/thread/promise/dcl list set exceptionTemplate:cpp/thread/promise/dcl list set exception at thread exit
Getting the result
Setting the result

Non-member functions

Template:cpp/thread/promise/dcl list swap2

Helper classes

Template:cpp/thread/promise/dcl list uses allocator