NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
载入中...
搜索中...
未找到
exception_ptr类 参考

异常指针类 更多...

#include <exception_ptr.hpp>

struct  ecb
 异常控制块 更多...

Public 成员函数

 exception_ptr (nullptr_t np=nullptr) noexcept
 默认构造函数
 exception_ptr (const exception_ptr &other) noexcept
 拷贝构造函数
 exception_ptr (exception_ptr &&other) noexcept
 移动构造函数
 ~exception_ptr () noexcept
 析构函数
exception_ptroperator= (const exception_ptr &other) noexcept
 拷贝赋值运算符
exception_ptroperator= (exception_ptr &&other) noexcept
 移动赋值运算符
void swap (exception_ptr &other) noexcept
 交换两个异常指针
 operator bool () const noexcept
 布尔转换运算符
bool operator== (const exception_ptr &rhs) const noexcept
 相等比较运算符
bool operator!= (const exception_ptr &rhs) const noexcept
 不等比较运算符
bool operator== (nullptr_t) const noexcept
 与空指针比较相等
bool operator!= (nullptr_t) const noexcept
 与空指针比较不等
NEFORCE_NODISCARD const std::type_info & exception_type () const noexcept
 获取异常类型信息

详细描述

异常指针类

用于跨函数边界共享异常对象,支持引用计数和异常重新抛出。

在文件 exception_ptr.hpp109 行定义.

构造及析构函数说明

◆ exception_ptr() [1/3]

exception_ptr::exception_ptr ( nullptr_t np = nullptr)
inlinenoexcept

默认构造函数

参数
np空指针字面量

创建一个空的异常指针,不引用任何异常。

在文件 exception_ptr.hpp172 行定义.

◆ exception_ptr() [2/3]

exception_ptr::exception_ptr ( const exception_ptr & other)
inlinenoexcept

拷贝构造函数

参数
other要拷贝的异常指针

增加引用计数,共享异常对象。

在文件 exception_ptr.hpp180 行定义.

◆ exception_ptr() [3/3]

exception_ptr::exception_ptr ( exception_ptr && other)
inlinenoexcept

移动构造函数

参数
other要移动的异常指针

转移异常指针的所有权,不增加引用计数。

在文件 exception_ptr.hpp193 行定义.

◆ ~exception_ptr()

exception_ptr::~exception_ptr ( )
inlinenoexcept

析构函数

减少引用计数,当引用计数为0时释放资源。

在文件 exception_ptr.hpp203 行定义.

成员函数说明

◆ exception_type()

NEFORCE_NODISCARD const std::type_info & exception_ptr::exception_type ( ) const
inlinenoexcept

获取异常类型信息

返回
异常的类型信息

如果异常指针为空,返回typeid(void)。

在文件 exception_ptr.hpp295 行定义.

◆ operator bool()

exception_ptr::operator bool ( ) const
inlineexplicitnoexcept

布尔转换运算符

返回
是否持有异常

检查异常指针是否非空。

在文件 exception_ptr.hpp249 行定义.

◆ operator!=() [1/2]

bool exception_ptr::operator!= ( const exception_ptr & rhs) const
inlinenoexcept

不等比较运算符

参数
rhs右操作数
返回
是否不相等

在文件 exception_ptr.hpp265 行定义.

◆ operator!=() [2/2]

bool exception_ptr::operator!= ( nullptr_t ) const
inlinenoexcept

与空指针比较不等

返回
是否非空

在文件 exception_ptr.hpp282 行定义.

◆ operator=() [1/2]

exception_ptr & exception_ptr::operator= ( const exception_ptr & other)
inlinenoexcept

拷贝赋值运算符

参数
other要拷贝的异常指针
返回
当前异常指针的引用

在文件 exception_ptr.hpp214 行定义.

引用了 addressof() , 以及 swap().

◆ operator=() [2/2]

exception_ptr & exception_ptr::operator= ( exception_ptr && other)
inlinenoexcept

移动赋值运算符

参数
other要移动的异常指针
返回
当前异常指针的引用

在文件 exception_ptr.hpp228 行定义.

引用了 addressof(), move() , 以及 swap().

◆ operator==() [1/2]

bool exception_ptr::operator== ( const exception_ptr & rhs) const
inlinenoexcept

相等比较运算符

参数
rhs右操作数
返回
是否相等

比较两个异常指针是否引用同一个异常对象。

在文件 exception_ptr.hpp258 行定义.

◆ operator==() [2/2]

bool exception_ptr::operator== ( nullptr_t ) const
inlinenoexcept

与空指针比较相等

返回
是否为空

在文件 exception_ptr.hpp271 行定义.

◆ swap()

void exception_ptr::swap ( exception_ptr & other)
inlinenoexcept

交换两个异常指针

参数
other要交换的异常指针

在文件 exception_ptr.hpp241 行定义.

引用了 swap().

被这些函数引用 swap().


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