std::promise::promise

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)

Constructs a promise object.

1) Default constructor. Constructs the promise with an empty shared state.
2) Constructs the promise with an empty shared state. The shared state is allocated using alloc. Alloc must meet the requirements of Allocator.
3) Move constructor. Constructs the promise with the shared state of other using move semantics. After construction, other has no shared state.
4) promise is not copyable.

Parameters

alloc - allocator to use to allocate the shared state
other - another promise to acquire the state from

Exceptions

1-2) (none)
3)
noexcept specification:
noexcept

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
http://en.cppreference.com/w/cpp/thread/promise/promise

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部