名前空間
変種
操作

標準ライブラリヘッダ <typeindex> (C++11)

From cppreference.com
 
 
標準ライブラリヘッダー
 

このヘッダは型サポートライブラリの一部です。

目次

インクルード

(C++20)
三方比較演算子のサポート[編集]

クラス

type_info オブジェクトのラッパー。連想コンテナや非順序連想コンテナのインデックスとして使用できる
(クラス) [編集]
std::type_index のハッシュサポート
(クラステンプレートの特殊化) [編集]
前方宣言
ヘッダ <functional> で定義
(C++11)
ハッシュ関数オブジェクト
(クラステンプレート) [編集]

[編集] 概要

#include <compare>
 
namespace std {
  class type_index;
  template<class T> struct hash;
  template<> struct hash<type_index>;
}

[編集] クラス std::type_index

namespace std {
  class type_index {
  public:
    type_index(const type_info& rhs) noexcept;
    bool operator==(const type_index& rhs) const noexcept;
    bool operator< (const type_index& rhs) const noexcept;
    bool operator> (const type_index& rhs) const noexcept;
    bool operator<=(const type_index& rhs) const noexcept;
    bool operator>=(const type_index& rhs) const noexcept;
    strong_ordering operator<=>(const type_index& rhs) const noexcept;
    size_t hash_code() const noexcept;
    const char* name() const noexcept;
 
  private:
    const type_info* target; // exposition only
    // Note that the use of a pointer here, rather than a reference,
    // means that the default copy/move constructor and assignment
    // operators will be provided and work as expected.
  };
}
English 日本語 中文(简体) 中文(繁體)