__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, _Traits again, 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, _Traits said so πŸŽ€
  • typedef _Traits::value_type value_type β€” the value type, _Traits runs this whole section ngl 🧚

πŸ’œ Public Member Functions πŸ’œ

  • debug_allocator (const _Alloc &__a) β€” constructor that takes a const _Alloc & named __a πŸ”₯
  • template<typename _Alloc2 > debug_allocator (const debug_allocator< _Alloc2 > &__a2, typename __convertible< _Alloc2 >::__type=0) β€” the converting constructor, takes __a2 and that second param defaults to 0 ⭐
  • pointer allocate (size_type __n) β€” hands you a pointer for __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 __p with the forwarded __args πŸŽ€
  • void construct (pointer __p, const value_type &__val) β€” constructs at __p from __val πŸ’–
  • void deallocate (pointer __p, size_type __n) β€” gives the memory back, __p and __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 a throw () 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 __lhs and __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