名稱空間
變體
操作

標準庫標頭檔案 <typeinfo>

來自 cppreference.com
 
 
標準庫標頭檔案
演算法
<algorithm>
<numeric>
字串
<cctype>
<cstring>
<cuchar> (C++11)
<cwchar>
<cwctype>
<string_view> (C++17)
<string>
文字處理
<clocale>
<codecvt> (C++11/17/26*)
<locale>
<regex> (C++11)
<text_encoding> (C++26)   
數值
<cfenv> (C++11)
<cmath>
<complex>
<linalg> (C++26)
<numbers> (C++20)
<random> (C++11)
<simd> (C++26)
<valarray>
時間
<chrono> (C++11)
<ctime>
C 相容性
<ccomplex> (C++11/17/20*)
<ciso646> (直至 C++20)
<cstdalign> (C++11/17/20*)
<cstdbool> (C++11/17/20*)
<ctgmath> (C++11/17/20*)
 

此標頭檔案是 型別支援 庫的一部分。

目錄

[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;
  };
}