std::type_index(3)

πŸ’– std::type_index β€” the manual page, but make it make sense πŸ’–

okay bestie, welcome to std::type_index(3) from the Library Functions Manual, and yes we're doing this together because you deserve to actually get it 🫢


✨ NAME ✨

std::type_index β€” it's a class. that's the whole name. iconic behaviour honestly πŸ‘‘


🌸 SYNOPSIS 🌸

first things first, you gotta invite it to the party:

#include <typeindex>

πŸŽ€ Public Member Functions πŸŽ€

here's the whole roster, no one's getting left out:

type_index (const type_info &__rhs) noexcept
size_t hash_code () const noexcept
const char * name () 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
bool operator> (const type_index &__rhs) const noexcept
bool operator>= (const type_index &__rhs) const noexcept

notice how every single one of them is noexcept? the way that this class simply refuses to throw is giving emotional stability πŸ’… she does not do drama, she does not do exceptions, she just vibes ✨


πŸ¦‹ Detailed Description πŸ¦‹

so, Class type_index.

here's the tea: type_index is a cute little wrapper around type_info. that's it, that's the job. she's a glow-up for type_info so you can actually use her as an index type β€” specifically in associative containers (23.6) and in unordered associative containers (23.7) 🌈

like, type_info alone couldn't sit in those containers, and type_index said "not on my watch" and stepped in. main character energy fr fr πŸ”₯


πŸ’œ Author πŸ’œ

Generated automatically by Doxygen for libstdc++ from the source code.

so no human wrote this, a robot did, and the robot ate πŸ“


and that's the whole page bestie!! mwah πŸ’‹ this was libstdc++, std::type_index(3), and she's perfect, no notes πŸ‘‘βœ¨πŸŽ€

πŸ“¦ where this page comes from
  • arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 Β· GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
  • fedora 44: libstdc++-docs 16.0.1-0.10.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • fedora 44: libstdc++-docs 16.2.1-2.fc44
  • fedora 44: libstdc++-docs 16.2.1-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms