METAPROGRAMMING(3)
π NAME π
Type Traits β that's the whole title, bestie β¨
This page lives in the Library Functions Manual section, filed under Type Traits(3), and it's the libstdc++ type-traits catalogue. Everything here is compile time type transformation and information β the page's own words, not mine π«Ά (I mean, it also says that in the Detailed Description section, so like, spoiler alert, whatever π
).
If you've ever written std::is_integral<T>::value and felt like a genius, congrats, this is your house π β¨
πΈ Classes πΈ
Okay so this is the main event, bestie. Forty-four structs, all in std::, all doing their little type-trait thing. Here they are, in the exact order the page gives them, no cap:
struct std::__is_member_pointer_helper< _Tp >βis_member_pointerπ (yes it's got the double underscore, it's an implementation-detail icon)struct std::add_const< _Tp >βadd_constβ¨struct std::add_cv< _Tp >βadd_cvβ¨struct std::add_lvalue_reference< _Tp >βadd_lvalue_referenceπ«struct std::add_pointer< _Tp >βadd_pointerπstruct std::add_rvalue_reference< _Tp >βadd_rvalue_referenceπ«struct std::add_volatile< _Tp >βadd_volatileβ¨struct std::alignment_of< _Tp >βalignment_ofπstruct std::extent< typename, _Uint >βextentπstruct std::has_virtual_destructor< _Tp >βhas_virtual_destructorπstruct std::integral_constant< _Tp, __v >βintegral_constantπ (genuinely the main character of this whole lineup, ngl)struct std::is_abstract< _Tp >βis_abstractπ¦struct std::is_arithmetic< _Tp >βis_arithmeticπ’struct std::is_array< typename >βis_arrayπstruct std::is_class< _Tp >βis_classπstruct std::is_compound< _Tp >βis_compoundπ§struct std::is_const< typename >βis_constβ¨struct std::is_empty< _Tp >βis_emptyπ«struct std::is_enum< _Tp >βis_enumπΈstruct std::is_floating_point< _Tp >βis_floating_pointπstruct std::is_function< typename >βis_functionβstruct std::is_fundamental< _Tp >βis_fundamentalπstruct std::is_integral< _Tp >βis_integralπ’struct std::is_lvalue_reference< typename >βis_lvalue_referenceπ«struct std::is_member_function_pointer< _Tp >βis_member_function_pointerπstruct std::is_member_object_pointer< _Tp >βis_member_object_pointerπstruct std::is_object< _Tp >βis_objectπ§Έstruct std::is_pointer< _Tp >βis_pointerπstruct std::is_polymorphic< _Tp >βis_polymorphicπ¦struct std::is_reference< _Tp >βis_referenceπ«struct std::is_rvalue_reference< typename >βis_rvalue_referenceπ«struct std::is_same< typename, typename >βis_sameπ― (twotypenames, one vibe check)struct std::is_scalar< _Tp >βis_scalarπΎstruct std::is_union< _Tp >βis_unionπ€struct std::is_void< _Tp >βis_voidπ³οΈstruct std::is_volatile< typename >βis_volatileβ‘struct std::rank< typename >βrankπstruct std::remove_all_extents< _Tp >βremove_all_extentsπ§Ήstruct std::remove_const< _Tp >βremove_constπ§Ήstruct std::remove_cv< _Tp >βremove_cvπ§Ήstruct std::remove_extent< _Tp >βremove_extentπ§Ήstruct std::remove_pointer< _Tp >βremove_pointerπ§Ήstruct std::remove_reference< _Tp >βremove_referenceπ§Ήstruct std::remove_volatile< _Tp >βremove_volatileπ§Ή
π Defines π
The macro squad. Copy these exactly, bestie β underscores everywhere, do not freestyle:
#define _DEFINE_SPEC(_Order, _Trait, _Type, _Value)β the one with actual arguments β¨#define _DEFINE_SPEC_0_HELPERβ helper numero zero π#define _DEFINE_SPEC_1_HELPERβ helper numero one π#define _DEFINE_SPEC_2_HELPERβ helper numero two π
π¦ Typedefs π¦
Just two, but they're iconic:
typedef integral_constant< bool, false > std::false_typeβ literallyfalse_typeπtypedef integral_constant< bool, true > std::true_typeβ literallytrue_typeπ
π Variables π
static const _Tp std::integral_constant::valueβ thevaluemember ofintegral_constant,static const,_Tptyped. She's the payload π
β¨ Detailed Description β¨
Compile time type transformation and information.
That's it. That's the whole detailed description. Short, sweet, and honestly kind of a flex ππ
π₯ Typedef Documentation π₯
πΈ typedef integral_constant<bool, false> std::false_type πΈ
Okay so this is the false_type typedef β a typedef for false_type, as the page puts it π«Ά
Defined at line 78 of file tr1_impl/type_traits π
πΈ typedef integral_constant<bool, true> std::true_type πΈ
And this one's the true_type typedef β a typedef for true_type. Yes, the documentation says the thing is the thing. We love a self-aware queen π
β¨
Defined at line 75 of file tr1_impl/type_traits π
π§ Author π§
Generated automatically by Doxygen for libstdc++ from the source code. Not a human, not a group chat, just Doxygen doing its little automated slay π€β¨
Okay that's the whole page, bestie β every struct, every define, every typedef, every line number, nothing skipped π«Ά
Signing off with the footer energy: this is libstdc++, dated 21 Apr 2009, and the page is Type Traits(3) β catch you in the next manpage πππ¦
π¦ where this page comes from
- nixpkgs unstable: std-man-pages 4.4.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms