Share via


shared_future::get Method

Retrieves the result that's stored in the associated asynchronous state.

const Ty& get() const;
Ty& get() const;
void get() const;

Remarks

If the result is an exception, the method rethrows it. Otherwise, the result is returned.

Before it retrieves the result, this method blocks the current thread until the associated asynchronous state is ready.

For the partial specialization shared_future<Ty&>, the stored value is effectively a reference to the object that was passed to the asynchronous provider as the return value.

Because no stored value exists for the specialization shared_future<void>, the method returns void.

Requirements

Header: future

Namespace: std

See Also

Reference

shared_future Class

<future>