type_index クラス

type_index クラスは、type_info クラスへのポインターをラップして、このクラスのオブジェクトでインデックスを作成しやすくします。

クラス type_index { public: type_index(const type_info& tinfo); const char *name() const; size_t hash_code() const; bool operator==(const type_info> const; bool operator!=(const type_info> right) const; bool operator<(const type_info> const; bool operator<=(const type_info& right) const; bool operator>(const type_info& right) const; bool operator>=(const type_info& right) const; };

このコンストラクターは、ptr を &tinfoに初期化します。

name は ptr->name() を返します。

hash_code は ptr->hash_code() を返します。

operator== は *ptr == right.ptr を返します。

operator!= は !(*this == right) を返します。

operator< は *ptr->before(*right.ptr) を返します。

operator<= は !(right < *this) を返します。

operator> は right < *this を返します。

operator>= は !(*this < right) を返します。

関連項目

ランタイム型情報
<typeindex>