首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::promise::promise

promise();

(1)

(since C++11)

template< class Alloc > promise( std::allocator_arg_t, const Alloc& alloc );

(2)

(since C++11)

promise( promise&& other );

(3)

(since C++11)

promise( const promise& other ) = delete;

(4)

(since C++11)

构造一个promise对象。

1%29默认构造函数。以空共享状态构造承诺。

2%29以空共享状态构造承诺。使用alloc...Alloc必须符合Allocator...

3%29移动构造函数。的共享状态构造承诺。other使用移动语义。建造后,other没有共享状态。

4%29promise是不可复制的。

参数

alloc

-

allocator to use to allocate the shared state

other

-

another promise to acquire the state from

例外

1-2%29%280%29

3%29

noexcept规格:

noexcept

代码语言:txt
复制
 ? cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com