std::future<T>::share

Transfers the shared state of *this, if any, to a std::shared_future object. Multiple std::shared_future objects may reference the same shared state, which is not possible with std::future.

# Declarations

std::shared_future<T> share() noexcept;

# Return value

A std::shared_future object containing the shared state previously held by *this, if any, constructed as if by std::shared_future(std::move(*this)).

# Example

This section is incompleteReason: no example

# Defect reports

DRApplied toBehavior as publishedCorrect behavior
LWG 2556C++11share() requires valid() to be truerequirement removed and made noexcept

# See also