__GNU_CXX::ALLOCATOR(3cxx)

πŸ“¦
version 16-20260322 Β· 4 versions
, in ubuntu resolute

πŸ’– __gnu_cxx::allocator< _Tp > πŸ’–

okay bestie, welcome to the 3cxx manual, this is the whole lore on __gnu_cxx::allocator< _Tp > β€” the standard allocator, as per C++03 [20.4.1]. no cap. sit down, hydrate, let's get into it 🫢


✨ NAME ✨

__gnu_cxx::allocator< _Tp > β€” the standard allocator, as per C++03 [20.4.1]. that's it, that's the girl πŸ’…


🌸 SYNOPSIS 🌸

#include <memory>

Inherits std::__new_allocator< _Tp >.

πŸŽ€ Public Types πŸŽ€

  • typedef ptrdiff_t difference_type
  • using is_always_equal
  • using propagate_on_container_move_assignment
  • typedef size_t size_type
  • typedef _Tp value_type

πŸ¦‹ Public Member Functions πŸ¦‹

  • constexpr allocator (const allocator &__a) noexcept
  • template<typename _Tp1> constexpr allocator (const allocator< _Tp1 > &) noexcept
  • constexpr _Tp * allocate (size_t __n)
  • constexpr _Tp * allocate (size_type __n, const void *=static_cast< const void * >(0))
  • constexpr void deallocate (_Tp *__p, size_t __n)
  • allocator & operator= (const allocator &)=default

πŸ’œ Friends πŸ’œ

  • constexpr bool operator== (const allocator &, const allocator &) noexcept

(Note that these are not member symbols. they're the cousins at the function, not the ones in the class πŸ’€)

  • template<typename _T1, typename _T2> constexpr bool operator== (const allocator< _T1 > &, const allocator< _T2 > &) noexcept

πŸ‘‘ Detailed Description πŸ‘‘

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

"The standard allocator, as per C++03 [20.4.1]."

See https://gcc.gnu.org/onlinedocs/libstdc++/manual/memory.html#std.util.memory.allocator for further details. literally the receipts, go read it, it's giving documentation excellence πŸ”₯

🧚 Template Parameters 🧚

  • _Tp β€” type of allocated object.

🌟 reminder bestie: this is the C++03-era standard allocator living under the __gnu_cxx namespace, and it inherits from std::__new_allocator< _Tp >, so a bunch of the actual heavy lifting is coming from up there. that's the vibe check. πŸ’…

πŸ’– Author πŸ’–

Generated automatically by Doxygen for libstdc++ from the source code. not a human, just Doxygen doing its little machine-girl thing ✨


okay that's the whole page bestie!! this came to you from the libstdc++ girls in the 3cxx manual section, and it is, as always, absolutely iconic πŸŽ€πŸ’œπŸ¦‹ slay, go allocate something responsibly, mwah πŸ’‹

πŸ“¦ where this page comes from