首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

exception

此标头是错误处理图书馆。

*。

标准库组件引发的异常的异常基类%28class%29

巢式[医]异常%28C++11%29 a混合类型以捕获和存储当前异常%28class%29

坏[医]当STD::Current引发异常时引发的异常[医]异常无法复制异常对象%28类%29

台培

在违反动态异常规范时调用C++17%29函数之前,未预料到的%28函数%29

意料之外[医]处理程序%28,直到C++17%29,由std调用的函数的类型::意外的%28

终止[医]处理由std::Terminate%28tyduif%29调用的函数的类型

例外[医]用于处理异常对象的PTR%28C++11%29共享指针类型

功能

隐秘[医]例外[医]异常%28C++17%29检查是否正在进行异常处理

制造[医]例外[医]PTR%28C++11%29创建一个std::Exception[医]来自异常对象%28函数模板%29的PTR

电流[医]异常%28C++11%29捕获std::Exception中的当前异常[医]PTR%28功能%29

重投[医]异常%28C++11%29从std::Exception抛出异常[医]PTR%28功能%29

抛出[医]带着[医]嵌套%28C++11%29使用std::nested29抛出它的参数[医]%28函数模板中混合的异常%29

重投[医]如果[医]嵌套%28C++11%29抛出从std::nestedn异常[医]异常%28函数模板%29

异常处理失败时调用的终止函数%28函数%29

弄到[医]终止%28C++11%29获得当前终止[医]处理程序%28功能%29

集[医]终止更改由std::终止%28函数%29调用的函数

弄到[医]意外%28C++11%29%28直到C++17%29获得当前意外[医]处理程序%28功能%29

集[医]意外%28,直到C++17%29更改由std调用的函数::意外%28函数%29

简介

二次

代码语言:javascript
复制
namespace std {
    class exception;
    class bad_exception;
    class nested_exception;
 
    typedef void (*unexpected_handler)();
    unexpected_handler get_unexpected() noexcept;
    unexpected_handler set_unexpected(unexpected_handler f) noexcept;
    [[noreturn]] void unexpected();
 
    typedef void (*terminate_handler)();
    terminate_handler get_terminate() noexcept;
    terminate_handler set_terminate(terminate_handler f) noexcept;
    [[noreturn]] void terminate() noexcept;
 
    bool uncaught_exception() noexcept;
 
    typedef /*unspecified*/ exception_ptr;
 
    exception_ptr current_exception() noexcept;
    [[noreturn]] void rethrow_exception(exception_ptr p);
    template<class E> exception_ptr make_exception_ptr(E e) noexcept;
 
    [[noreturn]] template <class T> void throw_with_nested(T&& t);
    template <class E> void rethrow_if_nested(const E& e);
}

二次

std::exception

二次

代码语言:javascript
复制
class exception {
public:
    exception() noexcept;
    exception(const exception&) noexcept;
    exception& operator=(const exception&) noexcept;
    virtual ~exception();
    virtual const char* what() const noexcept;
};

二次

std::bad_exception

二次

代码语言:javascript
复制
class bad_exception : public exception {
public:
    bad_exception() noexcept;
    bad_exception(const bad_exception&) noexcept;
    bad_exception& operator=(const bad_exception&) noexcept;
    virtual const char* what() const noexcept;
};

二次

std::nested_exception

二次

代码语言:javascript
复制
class nested_exception {
public:
    nested_exception() noexcept;
    nested_exception(const nested_exception&) noexcept = default;
    nested_exception& operator=(const nested_exception&) noexcept = default;
    virtual ~nested_exception() = default;
 
    // access functions
    [[noreturn]] void rethrow_nested() const;
    exception_ptr nested_ptr() const noexcept;
};

二次

另见

  • 错误处理
代码语言:txt
复制
 ? cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com