__GNU_CXX::DEBUG_ALLOCATOR(3cxx)
π
__gnu_cxx::debu...cator< _Alloc > β the 3cxx manual page, bestie edition π
okay so this is a page from the 3cxx manual (libstdc++'s very own doc set, we stan) and it's about a template class that is, and I quote, "A meta-allocator with debugging bits." β¨ That's the whole vibe. Let's get into it.
πΈ NAME πΈ
__gnu_cxx::debug_allocator< _Alloc > β a meta-allocator with debugging bits. literally what it says on the tin, no cap π
β¨ SYNOPSIS β¨
#include <debug_allocator.h>
π¦ Public Types π¦
typedef _Traits::const_pointer const_pointerβ the const pointer type, straight from_Traitsπtypedef _Traits::const_reference const_referenceβ the const reference type, also from_Traitsβ¨typedef _Traits::difference_type difference_typeβ the difference type,_Traitsagain, she's consistent πtypedef _Traits::pointer pointerβ the pointer type, courtesy of_Traitsπ«Άtypedef _Traits::reference referenceβ the reference type, yep,_TraitsπΈtypedef _Traits::size_type size_typeβ the size type,_Traitssaid so πtypedef _Traits::value_type value_typeβ the value type,_Traitsruns this whole section ngl π§
π Public Member Functions π
debug_allocator (const _Alloc &__a)β constructor that takes aconst _Alloc &named__aπ₯template<typename _Alloc2 > debug_allocator (const debug_allocator< _Alloc2 > &__a2, typename __convertible< _Alloc2 >::__type=0)β the converting constructor, takes__a2and that second param defaults to0βpointer allocate (size_type __n)β hands you apointerfor__nπpointer allocate (size_type __n, const void *__hint)β same but with a__hint, she'll take the suggestion π«template<typename _Tp , typename... _Args> void construct (_Tp *__p, _Args &&... __args)β constructs at__pwith the forwarded__argsπvoid construct (pointer __p, const value_type &__val)β constructs at__pfrom__valπvoid deallocate (pointer __p, size_type __n)β gives the memory back,__pand__n, bye bestie πtemplate<typename _Tp > void destroy (_Tp *__p)β destroys the thing at__pπsize_type max_size () const throw ()β the max size,const, and she's got athrow ()on her, very old-school π
π Friends π
template<typename _Alloc2 > bool operator== (const debug_allocator &__lhs, const debug_allocator< _Alloc2 > &__rhs) noexceptβ the equality operator,noexcept, comparing__lhsand__rhs, iconic π«Ά
π Detailed Description π
template<typename _Alloc>
class __gnu_cxx::debug_allocator< _Alloc >
"A meta-allocator with debugging bits." β that's the tagline, main character energy fr fr β¨
This is precisely the allocator defined in the C++03 Standard. yep, exactly that one, no substitutions, iykyk π
π Author π
Generated automatically by Doxygen for libstdc++ from the source code. so no human to thank for this one, the robot did it π€π
aaaand that's the page! π the footer line on this one reads libst__gnu_cxx::debu...cator< _Alloc >(3cxx) β that's your libstdc++ + 3cxx manual tag, cute little sign-off, mwah ππ¦
π¦ 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