次の方法で共有


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& right) const; bool operator!=(const type_info> right) const; bool operator<(const type_info> right) const; bool operator<=(const type_info& right) const; bool operator>(const type_info& right) const; bool operator>=(const type_info& right) const; };

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

nameptr->name() を返します。

hash_codeptr->hash_code() を返します。

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

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

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

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

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

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

関連項目

ランタイム型情報
<typeindex>