C++11
C++11 是 C++ 自 C++98 以来的第二个重要更新。大量更新被引入标准,提升了 C++ 的抽象程度。
诊断库
<exception> 和 <system_error> 提供了异常处理头文件和系统错误头文件。
捕获和存储异常对象
uncaught_exceptions std::terminate();// 默认调用 std::abort
typedef void(*terminate_handler )(); // 返回 set 之前的值
std::terminate_handler set_terminate( std::terminate_handler f ) noexcept;
std::terminate_handler get_terminate() noexcept;
元编程库
C++ 提供元编程工具,如 type traits, compile-time rational arithmetic, and compile-time integer sequences.
type traits 定义了编译时基于模板的类型属性查询接口。
一元 type traits 用于检查类型是 std::true_type / std::false_type。
<type_traits>
is_void: checks if a type is voidis_null_pointer: checks if a type is std::nullptr_tis_integral: checks if a type is an integral typeis_floating_point: checks if a type is a floating-point typeis_array: checks if a type is an array typeis_enum: checks if a type is an enumeration typeis_union: checks if a type is a union typeis_class: checks if a type is a non-union class typeis_function: checks if a type is a function typeis_pointer: checks if a type is a pointer typeis_lvalue_reference: checks if a type is an lvalue referenceis_rvalue_reference: checks if a type is an rvalue reference

