当前头文件是诊断库(Diagnostics library)中的部分内容。

诊断库(参考手册) ​诊断库(标准)

  • logic_error 逻辑错误异常
    invalid_argument 无效参数异常
    domain_error 定义域范围异常
    length_error 长度异常
    out_of_range 超出范围异常
    runtime_error 运行时异常
    range_error 范围异常
    overflow_error 算述溢出异常
    underflow_error 下溢异常
  • namespace std {
        class logic_error;
            class domain_error;
            class invalid_argument;
            class length_error;
            class out_of_range;
        class runtime_error;
            class range_error;
            class overflow_error;
            class underflow_error;
    }
  • class logic_error : public exception {
        public:
            explicit logic_error(const string& what_arg);
            explicit logic_error(const char* what_arg);
    };
     
    class domain_error : public logic_error {
        public:
            explicit domain_error(const string& what_arg);
            explicit domain_error(const char* what_arg);
    };
     
     
    class invalid_argument : public logic_error {
        public:
            explicit invalid_argument(const string& what_arg);
            explicit invalid_argument(const char* what_arg);
    };
     
     
    class length_error : public logic_error {
        public:
            explicit length_error(const string& what_arg);
            explicit length_error(const char* what_arg);
    };
     
     
    class out_of_range : public logic_error {
        public:
            explicit out_of_range(const string& what_arg);
            explicit out_of_range(const char* what_arg);
    };
     
    class runtime_error : public exception {
        public:
            explicit runtime_error(const string& what_arg);
            explicit runtime_error(const char* what_arg);
    };
     
    class range_error : public runtime_error {
        public:
            explicit range_error(const string& what_arg);
            explicit range_error(const char* what_arg);
    };
     
    class overflow_error : public runtime_error {
        public:
            explicit overflow_error(const string& what_arg);
            explicit overflow_error(const char* what_arg);
    };
     
    class underflow_error : public runtime_error {
        public:
            explicit underflow_error(const string& what_arg);
            explicit underflow_error(const char* what_arg);
    };