promise 类

Describes“异步提供程序” .

template<class Ty>
class promise;

成员

公共构造函数

Name

说明

promise::promise 构造函数

构造 promise 对象。

公共方法

Name

说明

promise::get_future 方法

返回与承诺有关的“将来” hh920539(v=vs.120).md

promise::set_exception 方法

基本设置承诺的结果指示异常。

promise::set_exception_at_thread_exit 方法

基本设置 的结果指示异常,只有在销毁后当前线程上的所有线程本地对象 (通常在线程退出时)才会传递通知。

promise::set_value 方法

基本设置承诺的结果指示值。

promise::set_value_at_thread_exit 方法

基本设置的结果指示异常,只有在销毁后当前线程上的所有线程本地对象 (通常在线程退出时)才会传递通知。

promise::swap 方法

交换“关联的异步状态” 与指定的承诺对象。

公共运算符

Name

说明

promise::operator= Operator

此承诺对象共享状态的分配。

继承层次结构

promise

要求

标头: future

命名空间: std

请参见

其他资源

C++ 标准库头文件