Share via


promise::promise Constructor

Constructs a promise object.

promise();
template<class Alloc>
promise(
   allocator_arg_t,
   const Alloc& Al
);
promise(
   promise&& Other
) _NOEXCEPT;

Parameters

  • Al
    A memory allocator. See <allocators> for more information.

  • Other
    A promise object.

Remarks

The first constructor constructs an emptypromise object.

The second constructor constructs an empty promise object and uses Al for memory allocation.

The third constructor constructs a promise object and transfers the associated asynchronous state from Other, and leaves Other empty.

Requirements

Header: future

Namespace: std

See Also

Reference

promise Class

<future>