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。

要求

**标头:**将来

**命名空间:**std

请参见

参考

promise Class

<future>