package |
Defined in
<concurrency/future.hpp> |
Create a promise/future pair
(1) | ||
(2) |
(1)
Parameters
unnamed | |||
unnamed |
(2)
The template function package creates a pair of a promise and a future. Calling the promise will be invoked immediately, not on the provided executor
. The purpose of the passed executor
is to have already an executor for an attached continuation. If the promise is destructed and have not been called, then the associated future contains a std::exception with the error code stlab::broken_promise
.
Parameters
unnamed |
The executor is the default executor for a possible attached continuation |
||
unnamed |
Callable object to call |
Returns
A std::pair of a promise and the associated future.