标准库标头 <typeinfo>
来自cppreference.com
此头文件是类型支持库的一部分。
目录 |
[编辑]类
包含某个类型的信息,typeid 运算符所返回的类 (类) | |
当 typeid 表达式中的实参为空值时抛出的异常 (类) | |
由非法的 dynamic_cast 表达式(即引用类型转型失败)抛出的异常 (类) |
[编辑]概要
namespace std {class type_info;class bad_cast;class bad_typeid;}
[编辑]类 std::type_info
namespace std {class type_info {public:virtual ~type_info();constexprbool operator==(const type_info& rhs)constnoexcept;bool before(const type_info& rhs)constnoexcept; size_t hash_code()constnoexcept;constchar* name()constnoexcept; type_info(const type_info&)= delete;// 不能复制 type_info& operator=(const type_info&)= delete;// 不能复制};}
[编辑]类 std::bad_cast
namespace std {class bad_cast :public exception {public:// 特殊成员函数的规定见 [exception]constchar* what()constnoexcept override;};}
[编辑]类 std::bad_typeid
namespace std {class bad_typeid :public exception {public:// 特殊成员函数的规定见 [exception]constchar* what()constnoexcept override;};}