Namespaces
Variants
Actions

std::shared_future<T>::get

From cppreference.com
 
 
Concurrency support library
Threads
(C++11)
(C++20)
this_thread namespace
(C++11)
(C++11)
(C++11)
Cooperative cancellation
Mutual exclusion
(C++11)
Generic lock management
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
Condition variables
(C++11)
Semaphores
Latches and Barriers
(C++20)
(C++20)
Futures
(C++11)
(C++11)
(C++11)
(C++11)
Safe reclamation
(C++26)
Hazard pointers
Atomic types
(C++11)
(C++20)
Initialization of atomic types
(C++11)(deprecated in C++20)
(C++11)(deprecated in C++20)
Memory ordering
(C++11)(deprecated in C++26)
Free functions for atomic operations
Free functions for atomic flags
 
 
Main template
const T& get() const;
(1) (since C++11)
std::shared_future<T&> specializations
T& get() const;
(2) (since C++11)
std::shared_future<void> specialization
void get() const;
(3) (since C++11)

The get member function waits (by calling wait()) until the shared state is ready, then retrieves the value stored in the shared state (if any).

If valid() is false before the call to this function, the behavior is undefined.

Contents

[