packaged_task::get_future Method

packaged_task::get_future Method

 

Returns an object of type future<Ty> that has the same associated asynchronous state.

future<Ty> get_future();

If the packaged_task object does not have an associated asynchronous state, this method throws a future_error that has an error code of no_state.

If this method has already been called for a packaged_task object that has the same associated asynchronous state, the method throws a future_error that has an error code of future_already_retrieved.

Requirements

Header: future

Namespace: std

Show:
© 2016 Microsoft