promise::promise 构造函数

构造 promise 对象。

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

参数

  • Al
    内存分配器。 有关更多信息,请参见<allocators>

  • Other
    一个 promise 对象。

备注

第一构造函数构造一 个promise 对象。

第二个构造函数构造一个空 promise 对象并为存储分配使用 Al。

第三个构造函数构造 promise 对象并将从 Other的关联异步的状态,并且保留 Other。

要求

标头: future

命名空间: std

请参见

参考

promise 类

<future>