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 ( ) ;
(自 C++11 起)

释放所有共享状态。这意味着:

  • 若当前对象持有其共享状态的最后引用,则共享状态将被销毁。
  • 当前对象放弃对其共享状态的引用。
  • 以下操作通常不会因等待共享状态就绪而阻塞,除非满足以下所有条件时可能发生阻塞:
    • 该共享状态是通过调用 std::async 创建的。
    • 共享状态尚未就绪。
    • 当前对象是共享状态的最后一个引用。
(since C++14)