标准库头文件 <typeinfo>
来自 cppreference.cn
此头文件是 类型支持 库的一部分。
目录 |
[edit] 类
包含某些类型信息的类,由 typeid 运算符返回 (类) | |
当 typeid 表达式 中的参数为 null 时抛出的异常 (类) | |
当 dynamic_cast 表达式无效时(即引用类型的转换失败时)抛出的异常 (类) |
[edit] 提要
namespace std { class type_info; class bad_cast; class bad_typeid; }
[edit] 类 std::type_info
namespace std { class type_info { public: virtual ~type_info(); constexpr bool operator==(const type_info& rhs) const noexcept; bool before(const type_info& rhs) const noexcept; size_t hash_code() const noexcept; const char* name() const noexcept; type_info(const type_info&) = delete; // cannot be copied type_info& operator=(const type_info&) = delete; // cannot be copied }; }
[edit] 类 std::bad_cast
namespace std { class bad_cast : public exception { public: // see [exception] for the specification of the special member functions const char* what() const noexcept override; }; }
[edit] 类 std::bad_typeid
namespace std { class bad_typeid : public exception { public: // see [exception] for the specification of the special member functions const char* what() const noexcept override; }; }