public member function
<future>
std::shared_future::get generic template (1)const T& get() const;reference specialization (2)
R& shared_future<R&>::get() const; // when T is a reference type (R&)void specialization (3)
void shared_future<void>::get() const; // when T is void
Get value
Returns a reference to the value stored in the shared state (or throws its exception) when the shared state is ready.If the shared state is not yet ready (i.e., the provider has not yet set its value or exception), the function blocks the calling thread and waits until it is ready.
Once the shared state is ready, the function unblocks and returns (or throws), but does not release its shared state (unlike future::get), allowing other shared_future objects to also access the stored value (or new accesses by the same object).
All visible side effects are synchronized between the point the provider makes the shared state ready and the return of this function, but note that no synchronization exists among the potential multiple functions returning on this event (in case of multiple shared_future objects were waiting for the same shared state).
The member of the void
specialization (3) does not return any value, but still waits for the shared state to become ready before returning/throwing.
Calling this member function on a shared_future object that is not valid, produces undefined behavior (although library implementations may detect this and throw future_error with a no_state error condition).
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