std::type_index(3cxx)

okay so this page is std::type_index from the libstdc++ manual, section 3cxx β€” pull up a chair bestie, we're wrapping a type. πŸ’…

🌸 NAME 🌸

std::type_index β€” literally the class type_index. That's the name, and it's giving β€œsmall but mighty.” ✨

✨ SYNOPSIS ✨

first things first, include the header:

#include <typeindex>

πŸŽ€ Public Member Functions πŸŽ€

  • type_index (const type_info &__rhs) noexcept β€” builds a type_index from the const type_info &__rhs, and yes it's noexcept, no cap.
  • size_t hash_code () const noexcept β€” gives you back a size_t hash code, const noexcept, slay.
  • const char * name () const noexcept β€” hands you the name as a const char *, const noexcept, iconic.
  • bool operator!= (const type_index &__rhs) const noexcept β€” the not-equal check against __rhs, returns bool, const noexcept.
  • bool operator< (const type_index &__rhs) const noexcept β€” the less-than check against __rhs, returns bool, const noexcept.
  • bool operator<= (const type_index &__rhs) const noexcept β€” the less-than-or-equal check against __rhs, returns bool, const noexcept.
  • bool operator== (const type_index &__rhs) const noexcept β€” the equality check against __rhs, returns bool, const noexcept.
  • bool operator> (const type_index &__rhs) const noexcept β€” the greater-than check against __rhs, returns bool, const noexcept.
  • bool operator>= (const type_index &__rhs) const noexcept β€” the greater-than-or-equal check against __rhs, returns bool, const noexcept.

πŸ¦‹ Detailed Description πŸ¦‹

Class type_index.

The class type_index provides a simple wrapper for type_info which can be used as an index type in associative containers (23.6) and in unordered associative containers (23.7). That's the whole vibe: a cute lil wrapper so type_info can sit in associative containers and unordered associative containers as an index type. Lowkey iconic. πŸ”₯

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for libstdc++ from the source code. So no mysterious human author bestie β€” Doxygen did the thing. 🫢


kisses from the libstdc++ girlies πŸ’– β€” source/version: libstdc++, page: std::type_index(3cxx), and the footer didn't show a date, so no invented date, periodt. 🌈

πŸ“¦ where this page comes from