Поделиться через


Класс 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.

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>