MSTL 1.4.0
A Modern C++ Library with extended functionality, web components, and utility libraries
载入中...
搜索中...
未找到
exception结构体 参考

异常基类 更多...

#include <exception.hpp>

类 exception 继承关系图:
[图例]

Public 成员函数

 exception (const char *info=static_type, const char *type=static_type, const int code=0)
 构造函数
 exception (const exception &other) noexcept
 复制构造函数
exceptionoperator= (const exception &other) noexcept
 复制赋值运算符
 exception (exception &&other) noexcept
 移动构造函数
exceptionoperator= (exception &&other) noexcept
 移动赋值运算符
template<typename Error>
 exception (const Error &error)
 模板构造函数
virtual ~exception ()=default
 虚析构函数
MSTL_NODISCARD const char * what () const noexcept
 获取错误信息
MSTL_NODISCARD const char * type () const noexcept
 获取异常类型
MSTL_NODISCARD int code () const noexcept
 获取异常码

静态 Public 属性

static constexpr auto static_type = "exception"
 静态类型字符串

详细描述

异常基类

在文件 exception.hpp77 行定义.

构造及析构函数说明

◆ exception() [1/2]

exception::exception ( const char * info = static_type,
const char * type = static_type,
const int code = 0 )
inlineexplicit

构造函数

参数
info异常信息
type异常类型
code异常码

在文件 exception.hpp93 行定义.

引用了 code(), static_type, string_copy() , 以及 type().

被这些函数引用 exception(), exception(), exception(), operator=() , 以及 operator=().

◆ exception() [2/2]

template<typename Error>
exception::exception ( const Error & error)
inlineexplicit

模板构造函数

模板参数
Error错误类型
参数
error错误对象

从其他异常类型构造。

在文件 exception.hpp158 行定义.

引用了 code(), exception(), type() , 以及 what().

成员函数说明

◆ code()

MSTL_NODISCARD int exception::code ( ) const
inlinenoexcept

获取异常码

返回
异常类型码

在文件 exception.hpp182 行定义.

被这些函数引用 exception() , 以及 exception().

◆ type()

MSTL_NODISCARD const char * exception::type ( ) const
inlinenoexcept

获取异常类型

返回
异常类型字符串

在文件 exception.hpp176 行定义.

被这些函数引用 exception() , 以及 exception().

◆ what()

MSTL_NODISCARD const char * exception::what ( ) const
inlinenoexcept

获取错误信息

返回
错误信息字符串

在文件 exception.hpp170 行定义.

被这些函数引用 exception().


该结构体的文档由以下文件生成: