public member function
<future>

std::shared_future::valid

bool valid() const noexcept;
Check for valid shared state
Returns whether the shared_future object is currently associated with a shared state or not.

For default-constructed shared_future objects, this function returns false (unless assigned a valid shared_future).

Shared futures obtain valid shared states either from a future or shared_future object (on construction or assigning them). Unlike future objects, they retain the same shared state association and validity until destroyed (or assigned).

引數



返回值

true if the object is associated with a shared state.
否則返回 false

資料競爭

shared_future 物件被訪問。

異常安全

無異常保證: 絕不丟擲異常。

另見