std::type_info(3cxx)
π
std::type_info β a 3cxx moment
ok so bestie, welcome to std::type_info, straight out of the 3cxx manual section. This is the little class that's part of RTTI β yes, runtime type info, the thing that knows who's who when your objects are being shady at runtime. β¨
πΈ NAME πΈ
std::type_info β literally part of RTTI, that's the whole vibe.
π SYNOPSIS π
#include <typeinfo>
π Inherited by
This icon is the parent of a whole friend group, no cap:
__cxxabiv1::__array_type_info__cxxabiv1::__class_type_info__cxxabiv1::__enum_type_info__cxxabiv1::__function_type_info__cxxabiv1::__fundamental_type_info__cxxabiv1::__pbase_type_info
π Public Member Functions
virtual ~type_info ()virtual bool __do_catch (const type_info *__thr_type, void **__thr_obj, unsigned __outer) constvirtual bool __do_upcast (const __cxxabiv1::__class_type_info *__target, void **__obj_ptr) constvirtual bool __is_function_p () constvirtual bool __is_pointer_p () constbool before (const type_info &__arg) const noexceptsize_t hash_code () const noexceptconst char * name () const noexceptconstexpr bool operator== (const type_info &__arg) const noexcept
π¦ Protected Member Functions
type_info (const char *__n)
π Protected Attributes
const char * __name
β¨ DETAILED DESCRIPTION β¨
Part of RTTI. Periodt. π
The type_info class describes type information generated by an implementation β so like, the compiler made this info, and type_info is the one holding it down and describing it. π
π§ CONSTRUCTOR & DESTRUCTOR DOCUMENTATION π§
π virtual std::type_info::~type_info () [virtual]
Okay so the destructor comes first β which sounds random but it's giving main character energy for a reason. Being the first non-inline virtual function, this controls in which translation unit the vtable gets emitted. The compiler uses that info to know where to emit the runtime-mandated type_info structures in the new-abi. So yeah, the destructor is lowkey running the whole operation. ππ₯
β MEMBER FUNCTION DOCUMENTATION β
πΈ bool std::type_info::before (const type_info & __arg) const [noexcept]
Returns true if *this precedes __arg in the implementation's collation order. That's it, that's the function β a little ordering vibe check. π«Ά
π const char * std::type_info::name () const [inline], [noexcept]
Returns an implementation-defined byte string β and bestie, hear me: this is not portable between compilers! π¨ Don't be out here assuming name() gives you the same thing everywhere, because it will not. π
Lowkey important: implementation-defined means the implementation defines it. Not you. Not your friend's compiler. Respect the boundary fr fr. π
π AUTHOR π
Generated automatically by Doxygen for libstdc++ from the source code. So nobody hand-wrote this, the robots did it, and honestly? Slay. π€β¨
okay that's the whole page, mwah π β this little icon came to you from libstdc++, filed under std::type_info(3cxx), and it's a whole vibe. go forth and RTTI responsibly π¦π
π¦ where this page comes from
- ubuntu noble: libstdc++-14-doc 14-20240412-0ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms