Namespaces
Variants

std::promise<R>:: promise

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
promise ( ) ;
(1) (C++11以降)
template < class Alloc >
promise ( std:: allocator_arg_t , const Alloc & alloc ) ;
(2) (C++11以降)
promise ( promise && other ) noexcept ;
(3) (C++11以降)
promise ( const promise & other ) = delete ;
(4) (C++11以降)

promise オブジェクトを構築します。

1) デフォルトコンストラクタ。空の共有状態でpromiseを構築します。
2) 空の共有状態でpromiseを構築します。共有状態は alloc を使用して割り当てられます。 Alloc Allocator の要件を満たさなければなりません。
3) ムーブコンストラクタ。 other の共有状態をムーブセマンティクスを使用して構築します。構築後、 other は共有状態を持ちません。
4) promise はコピー不可です。

パラメータ

alloc - 共有状態の割り当てに使用するアロケータ
other - 状態を取得する別の promise

例外

1,2) 実装定義の例外をスローする可能性があります。