標準庫標頭檔案 <typeinfo>
來自 cppreference.com
此標頭檔案是 型別支援 庫的一部分。
目錄 |
[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; }; }