Documentation Home >> Headers >> <jss/experimental_future.hpp> Header >> std::experimental::future >> std::experimental::future::share() member function

Constructs a new std::experimental::shared_future instance and transfers ownership of the asynchronous result associated with *this to this newly constructed std::experimental::shared_future instance.

shared_future<ResultType> share();

Effects:

As-if shared_future<ResultType>(std::move(*this)).

Postconditions:

The asynchronous result associated with *this prior to the invocation of share() (if any) is associated with the newly constructed std::experimental::shared_future instance. this->valid() returns false.

Throws:

Nothing.

Header

#include <experimental/future>

See Also