Namespaces
Variants

std::future<T>:: 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
future ( ) noexcept ;
(1) (自 C++11 起)
future ( future && other ) noexcept ;
(2) (自 C++11 起)
future ( const future & other ) = delete ;
(3) (自 C++11 起)

构造一个 std::future 对象。

1) 默认构造函数。构造一个无共享状态的 std::future 。构造后, valid ( ) == false
2) 移动构造函数。使用移动语义构造一个具有 other 共享状态的 std::future 。构造完成后, other. valid ( ) == false
3) std::future 不满足 CopyConstructible 要求。

参数

其他 - 用于从其他 std::future 获取共享状态的另一个对象