Namensräume
Varianten
Aktionen

Standardbibliothek-Header <typeindex> (C++11)

Von cppreference.com
< cpp‎ | header
 
 
Header der Standardbibliothek
Allgemeine Hilfsmittel
<any> (C++17)
<bitset>
<bit> (C++20)
<charconv> (C++17)
<expected> (C++23)
<format> (C++20)
<functional>
<optional> (C++17)
<tuple> (C++11)
<typeindex> (C++11)
<utility>
<variant> (C++17)
Container
<array> (C++11)
<deque>
<flat_map> (C++23)
<flat_set> (C++23)
<forward_list> (C++11)
<hive> (C++26)
<inplace_vector> (C++26)   
<list>
<map>
<mdspan> (C++23)
<queue>
<set>
<span> (C++20)
<stack>
<unordered_map> (C++11)
<unordered_set> (C++11)
<vector>
Iteratoren
<iterator>
Bereiche (Ranges)
<generator> (C++23)
<ranges> (C++20)
 

Dieser Header ist Teil der Typ-Unterstützungs-Bibliothek.

Inhalt

Includes

(C++20)
Unterstützung für den Drei-Wege-Vergleichsoperator[edit]

Klassen

Wrapper um ein type_info-Objekt, das als Index in assoziativen und ungeordneten assoziativen Containern verwendet werden kann
(Klasse) [bearbeiten]
Hash-Unterstützung für std::type_index
(Klassentemplate-Spezialisierung) [bearbeiten]
Vorwärtsdeklarationen
Definiert in der Header-Datei <functional>
(C++11)
Hash-Funktionsobjekt
(Klassenvorlage) [edit]

[bearbeiten] Synopsis

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

[bearbeiten] 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; // exposition only
    // Note that the use of a pointer here, rather than a reference,
    // means that the default copy/move constructor and assignment
    // operators will be provided and work as expected.
  };
}