Partager via


classe de type_index

La classe d'type_index encapsule un pointeur vers type_info, classe pour l'indexation par de ces objets.

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

Le constructeur initialise ptr à &tinfo.

name retourne ptr->name().

hash_code retourne ptr->hash_code().

operator== retourne *ptr == right.ptr.

operator!= retourne !(*this == right).

operator< retourne *ptr->before(*right.ptr).

operator<= retourne !(right < *this).

retourne right < *thisd'operator>.

operator>= retourne !(*this < right).

Voir aussi

Référence

Informations de type au moment de l'exécution

<typeindex>