MSTL 1.4.0
A Modern C++ Library with extended functionality, web components, and utility libraries
载入中...
搜索中...
未找到
promise< void >类 参考

void类型的promise特化 更多...

#include <promise.hpp>

Public 类型

using state_type = _INNER __future_base::state_base
 状态类型
using result_type = _INNER __future_base::basic_result<void>
 结果类型
using ptr_type = _INNER __future_base::Ptr<result_type>
 结果指针类型

Public 成员函数

 promise ()
 默认构造函数
 promise (promise &&other) noexcept
 移动构造函数
promiseoperator= (promise &&other) noexcept
 移动赋值运算符
 promise (const promise &)=delete
 禁止拷贝构造
promiseoperator= (const promise &)=delete
 禁止拷贝赋值
 ~promise ()
 析构函数
void swap (promise &other) noexcept
 交换两个promise对象
MSTL_NODISCARD future< void > get_future () const
 获取关联的future对象
void set_value ()
 设置void结果
void set_exception (exception_ptr exception)
 设置异常
void set_value_at_thread_exit ()
 在线程退出时设置void结果
void set_exception_at_thread_exit (exception_ptr exception)
 在线程退出时设置异常

详细描述

void类型的promise特化

在文件 promise.hpp272 行定义.

成员函数说明

◆ get_future()

MSTL_NODISCARD future< void > promise< void >::get_future ( ) const
inline

获取关联的future对象

返回
future对象

在文件 promise.hpp337 行定义.

◆ set_exception()

void promise< void >::set_exception ( exception_ptr exception)
inline

设置异常

参数
exception异常指针
异常
future_exception如果结果已被设置

在文件 promise.hpp354 行定义.

◆ set_exception_at_thread_exit()

void promise< void >::set_exception_at_thread_exit ( exception_ptr exception)
inline

在线程退出时设置异常

参数
exception异常指针
异常
future_exception如果结果已被设置

在文件 promise.hpp371 行定义.

◆ set_value()

void promise< void >::set_value ( )
inline

设置void结果

异常
future_exception如果结果已被设置

在文件 promise.hpp345 行定义.

◆ set_value_at_thread_exit()

void promise< void >::set_value_at_thread_exit ( )
inline

在线程退出时设置void结果

异常
future_exception如果结果已被设置

在文件 promise.hpp362 行定义.


该类的文档由以下文件生成: