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
© cppreference.com在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com

