Namespaces
Variants

std::shared_future<T>:: shared_future

From cppreference.net
Concurrency support library
Threads
(C++11)
(C++20)
this_thread namespace
(C++11)
(C++11)
Cooperative cancellation
Mutual exclusion
Generic lock management
Condition variables
(C++11)
Semaphores
Latches and Barriers
(C++20)
(C++20)
Futures
(C++11)
(C++11)
(C++11)
Safe reclamation
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
shared_future ( ) noexcept ;
(1) (depuis C++11)
(2)
shared_future ( const shared_future & other ) ;
(depuis C++11)
(jusqu'à C++17)
shared_future ( const shared_future & other ) noexcept ;
(depuis C++17)
shared_future ( std:: future < T > && other ) noexcept ;
(3) (depuis C++11)
shared_future ( shared_future && other ) noexcept ;
(4) (depuis C++11)

Construit un nouveau shared_future .

1) Constructeur par défaut. Construit un futur partagé vide, qui ne fait pas référence à un état partagé, c'est-à-dire que valid ( ) == false .
2) Construit un futur partagé qui fait référence au même état partagé, le cas échéant, que other .
3,4) Transfère l'état partagé détenu par other vers * this . Après la construction, other. valid ( ) == false , et this - > valid ( ) retourne la même valeur que other. valid ( ) aurait retournée avant la construction.

Paramètres

other - un autre objet futur à initialiser