Documentation Home >> Headers >> <future> Header >> std::shared_future >> std::shared_future Move-from-std::future Constructor

Construct a std::shared_future object from a std::future, transferring ownership of the asynchronous result associated with the std::future object to the newly-constructed std::shared_future.

shared_future(std::future<ResultType>&& other);

Effects:

Constructs a new std::shared_future instance.

Postconditions:

The asynchronous result associated with other prior to the invocation of the constructor is associated with the newly-constructed std::shared_future object. other has no associated asynchronous result.

Throws:

Nothing.

Header

#include <future>

See Also