C++异常
2018-06-06 本文已影响0人
szn好色仙人
异常处理




- <exception>头文件中定义了异常类exception和bad_exception,异常类exception是标准C++库中所有异常类的基类。
- <ios>头文件中定义了异常类ios_base::failure。
- <type_info>头文件中定义了异常类bad_cast和bad_typeid,当dynamic_cast失败时将抛出该异常类对象。
- <stdexcept>头文件中定义了其它所有的异常类,如logic_error 、out_of_range 、range_error、runtime_error等。