__GNU_CXX::ARRAY_ALLOCATOR_BASE(3cxx)

πŸ“¦
version 9.5.0 Β· 3 versions
, in ubuntu noble

πŸ’– __gnu_cxx::array_allocator_base< _Tp > β€” the 3cxx glow-up πŸ’–

okay bestie, sit down, hydrate, and let's talk about __gnu_cxx::array_allocator_base< _Tp >. This is a page from section 3cxx, which is the C++ corner of the manual, and yes it's giving "template meta brain rot" but it's actually so cute when you get it. πŸŽ€


✨ NAME ✨

__gnu_cxx::array_allocator_base< _Tp > β€” literally just the Base class. that's the whole vibe. it's the foundation, the groundwork, the mother of the family. πŸ’…


🌸 SYNOPSIS 🌸

first things first, you gotta pull it in:

#include <array_allocator.h>

and here's the tea: it's Inherited by __gnu_cxx::array_allocator< _Tp, _Array >. so it's not out here doing the main character thing solo, it's the parent, the blueprint, the one who raised them. 🫢

πŸ‘‘ Public Types

these are the little nickname aliases the class hands out, all of them, no skips:

  • typedef const _Tp * const_pointer
  • typedef const _Tp & const_reference
  • typedef ptrdiff_t difference_type
  • typedef _Tp * pointer
  • typedef _Tp & reference
  • typedef size_t size_type
  • typedef _Tp value_type

seven of them. iconic. seven little typedef besties. πŸ¦‹

πŸ’… Public Member Functions

every single one, in order, exactly as written, because we do NOT leave the girls behind:

  • const_pointer address (const_reference __x) const noexcept
  • pointer address (reference __x) const noexcept
  • template<typename _Up , typename... _Args> void construct (_Up *__p, _Args &&... __args)
  • void deallocate (pointer, size_type)
  • template<typename _Up > void destroy (_Up *__p)
  • size_type max_size () const noexcept

look at those variadic templates. chef's kiss. the ... is doing so much work and never gets credit. 😭


🌈 Detailed Description 🌈

so like, the whole class declaration is:

template<typename _Tp>
    class __gnu_cxx::array_allocator_base< _Tp >

and its entire personality is: Base class. that's it. that's the description. short, sweet, humble, knows its place. queen behavior honestly.

Definition at line 54 of file array_allocator.h.

like, remember that. line 54. it's important later, iykyk. πŸ‘‘


πŸŽ€ Member Typedef Documentation πŸŽ€

here's where every single typedef gets its own little spotlight moment, with its line number so you can go visit it:

  • template<typename _Tp > typedef const _Tp* __gnu_cxx::array_allocator_base< _Tp >::const_pointer
    • Definition at line 60 of file array_allocator.h.
  • template<typename _Tp > typedef const _Tp& __gnu_cxx::array_allocator_base< _Tp >::const_reference
    • Definition at line 62 of file array_allocator.h.
  • template<typename _Tp > typedef ptrdiff_t __gnu_cxx::array_allocator_base< _Tp >::difference_type
    • Definition at line 58 of file array_allocator.h.
  • template<typename _Tp > typedef _Tp* __gnu_cxx::array_allocator_base< _Tp >::pointer
    • Definition at line 59 of file array_allocator.h.
  • template<typename _Tp > typedef _Tp& __gnu_cxx::array_allocator_base< _Tp >::reference
    • Definition at line 61 of file array_allocator.h.
  • template<typename _Tp > typedef size_t __gnu_cxx::array_allocator_base< _Tp >::size_type
    • Definition at line 57 of file array_allocator.h.
  • template<typename _Tp > typedef _Tp __gnu_cxx::array_allocator_base< _Tp >::value_type
    • Definition at line 63 of file array_allocator.h.

note the line numbers bouncing around (60, 62, 58, 59, 61, 57, 63) β€” that's just how the source file is laid out, not me being chaotic. the file is the chaotic one. πŸ™ˆ


πŸ”₯ Member Function Documentation πŸ”₯

now the actual functions, and yes, we're keeping the [inline] and [noexcept] tags because they're part of the fit:

  • template<typename _Tp > const_pointer __gnu_cxx::array_allocator_base< _Tp >::address (const_reference __x) const [inline], [noexcept]
    • Definition at line 70 of file array_allocator.h.
  • template<typename _Tp > pointer __gnu_cxx::array_allocator_base< _Tp >::address (reference __x) const [inline], [noexcept]
    • Definition at line 66 of file array_allocator.h.
  • template<typename _Tp > template<typename _Up , typename... _Args> void __gnu_cxx::array_allocator_base< _Tp >::construct (_Up * __p, _Args &&... __args) [inline]
    • Definition at line 86 of file array_allocator.h.
  • template<typename _Tp > void __gnu_cxx::array_allocator_base< _Tp >::deallocate (pointer, size_type) [inline]
    • Definition at line 74 of file array_allocator.h.
  • template<typename _Tp > template<typename _Up > void __gnu_cxx::array_allocator_base< _Tp >::destroy (_Up * __p) [inline]
    • Definition at line 91 of file array_allocator.h.
  • template<typename _Tp > size_type __gnu_cxx::array_allocator_base< _Tp >::max_size () const [inline], [noexcept]
    • Definition at line 80 of file array_allocator.h.

okay notice how address shows up twice β€” one for const_reference and one for plain reference, both const, both [inline], both [noexcept]. that's not a typo, that's overload ✨slay✨. and construct and destroy are the template-in-template girlies, they contain multitudes (and typename... _Args). πŸ’€


πŸ’œ Author πŸ’œ

Generated automatically by Doxygen for libstdc++ from the source code.</purl>

(that's not a person, bestie, that's a tool. Doxygen wrote this page. nobody hand-typed it. it's machine-generated and still ate. πŸ€–πŸ’–)


and that's the whole page!! πŸŽ‰ go forth and allocate, or like, don't, since this is the base class and it's just chilling there being foundational. no cap, you understood this, i'm so proud. 🫢🌸

this lil tour was brought to you by libstdc++, section 3cxx β€” mwah, catch you in the next manpage, bestie!! πŸ’…βœ¨

πŸ“¦ where this page comes from