Error handling

来自cppreference.com
< cpp

 
 
实用工具库
类型的支持 (basic types, RTTI, type traits)
动态内存管理
错误处理
程序实用工具
可变参数函数
日期和时间
函数对象
initializer_list(C++11)
bitset
hash(C++11)
关系运算符
Original:
Relational operators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rel_ops::operator!=
rel_ops::operator>
rel_ops::operator<=
rel_ops::operator>=
双和元组
Original:
Pairs and tuples
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
pair
tuple(C++11)
piecewise_construct_t(C++11)
piecewise_construct(C++11)
掉期,远期和移动
Original:
Swap, forward and move
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
swap
forward(C++11)
move(C++11)
move_if_noexcept(C++11)
declval(C++11)
 
错误处理
异常处理
Original:
Exception handling
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
exception
uncaught_exception
exception_ptr(C++11)
make_exception_ptr(C++11)
current_exception(C++11)
rethrow_exception(C++11)
nested_exception(C++11)
throw_with_nested(C++11)
rethrow_if_nested(C++11)
异常处理故障
Original:
Exception handling failures
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
terminate
terminate_handler
get_terminate(C++11)
set_terminate
unexpected(过时了)
bad_exception
unexpected_handler(过时了)
get_unexpected(C++11)(过时了)
set_unexpected(过时了)
异常类
Original:
Exception categories
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
logic_error
invalid_argument
domain_error
length_error
out_of_range
runtime_error
range_error
overflow_error
underflow_error
错误代码
Original:
Error codes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
错误代码
errno
断言
Original:
Assertions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
assert
SYSTEM_ERROR设施
Original:
system_error facility
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
error_category(C++11)
generic_category(C++11)
system_category(C++11)
error_condition(C++11)
errc(C++11)
error_code(C++11)
system_error(C++11)
 

目录

[编辑] 异常处理

<exception>提供了一些相关的类和函数的C + +程序中的异常处理.
Original:
The header <exception> provides several classes and functions related to exception handling in C++ programs.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Defined in header <exception>
标准库组件抛出的异常的基类
Original:
base class for exceptions thrown by the standard library components
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类) [edit]
捕获和储存的异常对象
Original:
Capture and storage of exception objects
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
检查,如果异常处理是目前正在进行中
Original:
checks if exception handling is currently in progress
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(函数) [edit]
(C++11)
处理异常对象的共享指针类型
Original:
shared pointer type for handling exception objects
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(的typedef) [edit]
创建一个异常对象的std::exception_ptr
Original:
creates an std::exception_ptr from an exception object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(函数模板) [edit]
captures the current exception in a std::exception_ptr
(函数) [edit]
std::exception_ptr抛出的异常
Original:
throws the exception from an std::exception_ptr
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(函数) [edit]
一个mixin捕获和存储当前的异常的类型
Original:
a mixin type to capture and store current exceptions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类) [edit]
std::nested_exception混合
Original:
throws its argument with std::nested_exception mixed in
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(函数模板) [edit]
std::nested_exception抛出的异常
Original:
throws the exception from a std::nested_exception
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(函数模板) [edit]
异常处理故障的处理
Original:
Handling of failures in exception handling
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
异常处理函数调用时失败
Original:
function called when exception handling fails
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(函数) [edit]
std::terminate所调用的函数的类型的
Original:
the type of the function called by std::terminate
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(的typedef) [edit]
(C++11)
获得电流terminate_handler
Original:
obtains the current terminate_handler
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(函数) [edit]
改变功能被称为由std::terminate
Original:
changes the function to be called by std::terminate
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(函数) [edit]
处理违反异常规格
Original:
Handling of exception specification violations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(过时了)
函数调用动态的异常规范被违反时
Original:
function called when dynamic exception specification is violated
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(函数) [edit]
时抛出的异常动态异常规范被违反时,如果可能的话
Original:
exception thrown when dynamic exception specification is violated, if possible
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类) [edit]
(过时了)
std::unexpected所调用的函数的类型的
Original:
the type of the function called by std::unexpected
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(的typedef) [edit]
(C++11)(过时了)
获得电流unexpected_handler
Original:
obtains the current unexpected_handler
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(函数) [edit]
(过时了)
改变功能被称为由std::unexpected
Original:
changes the function to be called by std::unexpected
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(函数) [edit]

[编辑] 异常类

预定义了一些方便的类在头<stdexcept>报告特定的错误条件。这些类可以分为两类:“逻辑”错误“运行时”错误。逻辑错误的结果,在程序中的逻辑错误,是可以预防的。运行时错误是由于不可抗力事件的范围,该方案不容易被预测.
Original:
Several convenience classes are predefined in the header <stdexcept> to report particular error conditions. These classes can be divided into two categories: logic errors and runtime errors. Logic errors are a consequence of faulty logic within the program and may be preventable. Runtime errors are due to events beyond the scope of the program and can not be easily predicted.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Defined in header <stdexcept>
异常类,指示违反了逻辑前提或类不变量
Original:
exception class to indicate violations of logical preconditions or class invariants
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类)
异常类报告无效的参数
Original:
exception class to report invalid arguments
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类)
异常类报告域错误
Original:
exception class to report domain errors
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类)
异常类报告试图超过允许的最大大小
Original:
exception class to report attempts to exceed maximum allowed size
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类)
异常类报告的预期范围之外的参数
Original:
exception class to report arguments outside of expected range
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类)
异常类,表示只有在运行时检测到的条件
Original:
exception class to indicate conditions only detectable at run time
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类)
异常类报表范围的内部计算错误
Original:
exception class to report range errors in internal computations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类)
报告算术溢出的异常类
Original:
exception class to report arithmetic overflows
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类)
报告算术下溢的异常类
Original:
exception class to report arithmetic underflows
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类)

[编辑] 错误号

Defined in header <cerrno>
宏扩展到本地POSIX兼容线程错误号variable
(宏变量)
Original:
macro which expands to POSIX-compatible thread-local error number variable
(宏变量)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
[edit]
宏为标准的POSIX兼容的错误条件
Original:
macros for standard POSIX-compatible error conditions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(宏不变) [edit]

[编辑] 断言

断言帮助实现的前提条件检查程序中的.
Original:
Assertions help to implement checking of preconditions in programs.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
静态断言
检查(C++11 起)进行编译时断言
Original:
performs compile-time assertion checking (C++11 起)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
[edit]
Defined in header <cassert>
如果用户指定的条件是不true中止该程序。发布版本中可能会被禁用
Original:
aborts the program if the user-specified condition is not true. May be disabled for release builds
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(函数宏) [edit]

[编辑] 系统错误

<system_error>定义用于报告错误情况,从操作系统的类型和功能,数据流I / O,std::future,或其他低级别的API.
Original:
The header <system_error> defines types and functions used to report error conditions originating from the operating system, streams I/O, std::future, or other low-level APIs.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Defined in header <system_error>
(C++11)
错误类型的基类
Original:
base class for error categories
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类) [edit]
标识通用的错误类别
Original:
identifies the generic error category
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(函数) [edit]
(C++11)
识别操作系统错误类别
Original:
identifies the operating system error category
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(函数) [edit]
(C++11)
持有便携式的错误代码
Original:
holds a portable error code
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类) [edit]
(C++11)
std::error_condition列出所有标准<cerrno>宏常量枚举
Original:
the std::error_condition enumeration listing all standard <cerrno> macro constants
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类) [edit]
(C++11)
持有与平台相关的错误代码
Original:
holds a platform-dependent error code
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类) [edit]
(C++11)
使用异常类报告有一个ERROR_CODE的条件
Original:
exception class used to report conditions that have an error_code
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类) [edit]