Namespaces
Variants

Standard library header <typeindex> (C++11)

From cppreference.net
Standard library headers

Dieser Header ist Teil der Type-Support Bibliothek.

Inhaltsverzeichnis

Includes

(C++20)
Drei-Wege-Vergleichsoperator Unterstützung

Klassen

(C++11)
Wrapper um ein type_info Objekt, das als Index in assoziativen und ungeordneten assoziativen Containern verwendet werden kann
(Klasse)
Hash-Unterstützung für std::type_index
(Klassen-Template-Spezialisierung)
Vorwärtsdeklarationen
Definiert im Header <functional>
(C++11)
Hash-Funktionsobjekt
(Klassen-Template)

Übersicht

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

Klasse 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; // nur zur Darstellung
    // Beachten Sie, dass die Verwendung eines Zeigers hier, anstelle einer Referenz,
    // bedeutet, dass die Standard-Kopier-/Move-Konstruktoren und Zuweisungsoperatoren
    // bereitgestellt werden und wie erwartet funktionieren.
  };
}