Bagikan melalui


promise::get_future Method

Returns a future object that has the same associated asynchronous state as this promise.

future<Ty> get_future();

Remarks

If the promise object is empty, this method throws a future_error that has an error_code of no_state.

If this method has already been called for a promise 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

See Also

Reference

promise Class

<future>