A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://en.cppreference.com/w/cpp/algorithm/../language/../algorithm/../thread/future/share.html below:

std::future<T>::share - cppreference.com

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.

After calling share on a std::future, valid() == false.

[edit] Parameters

(none)

[edit] Return value

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

[edit] Example [edit] Defect reports

The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

DR Applied to Behavior as published Correct behavior LWG 2556 C++11 share() requires valid() to be true requirement removed and made noexcept [edit] See also waits for a value (possibly referenced by other futures) that is set asynchronously
(class template) [edit]

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4