A RetroSearch Logo

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

Search Query:

Showing content from https://en.cppreference.com/w/cpp/language/../coroutine/../thread/shared_future/valid.html below:

std::shared_future<T>::valid - cppreference.com

bool valid() const noexcept;

(since C++11)

Checks if the future refers to a shared state.

This is the case only for futures that were not default-constructed or moved from. Unlike std::future, std::shared_future's shared state is not invalidated when get() is called.

The behavior is undefined if any member function other than the destructor, the copy-assignment operator, the move-assignment operator, or valid is called on a shared_future that does not refer to shared state (although implementations are encouraged to throw std::future_error indicating no_state in this case). It is valid to move or copy from a shared_future object for which valid() is false.

[edit] Parameters

(none)

[edit] Return value

true if *this refers to a shared state, otherwise false.

[edit] Example [edit] See also waits for the result to become available
(public member function) [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