__GNU_CXX::_EXTPTR_ALLOCATOR(3cxx)

πŸŽ€ NAME πŸŽ€

okay bestie, welcome to the __gnu_cxx::_ExtPtr_allocator< _Tp >(3cxx) page β€” that's the __gnu_cxx manual, 3cxx section, and the class is __gnu_cxx::_ExtPtr_allocator< _Tp >. It's literally an example allocator which uses a non-standard pointer type. That's the whole assignment: allocator behavior, but the pointer type is doing a little extra. πŸ’…


✨ SYNOPSIS ✨

First things first, include this, no cap:

#include <extptr_allocator.h>

🌸 Public Types 🌸

Okay so the public typedefs are giving very structured, very "know your types" energy:

  • const_pointer β€” typedef _Pointer_adapter< _Relative_pointer_impl< const _Tp > > const_pointer
  • const_reference β€” typedef const _Tp & const_reference
  • difference_type β€” typedef std::ptrdiff_t difference_type
  • pointer β€” typedef _Pointer_adapter< _Relative_pointer_impl< _Tp > > pointer
  • reference β€” typedef _Tp & reference
  • size_type β€” typedef std::size_t size_type
  • value_type β€” typedef _Tp value_type

πŸ’… Public Member Functions πŸ’…

Here's the whole function roster, bestie β€” every signature stays exactly as-is:

  • same-type copy constructor, noexcept β€” _ExtPtr_allocator (const _ExtPtr_allocator &__rarg) noexcept
  • templated converting copy constructor, noexcept β€” template<typename _Up > _ExtPtr_allocator (const _ExtPtr_allocator< _Up > &__rarg) noexcept
  • underlying allocator peek β€” const std::allocator< _Tp > & _M_getUnderlyingImp () const
  • const address β€” const_pointer address (const_reference __x) const noexcept
  • non-const address β€” pointer address (reference __x) const noexcept
  • allocate β€” pointer allocate (size_type __n, const void *=0)
  • templated construct at _Up * β€” template<typename _Up , typename... _Args> void construct (_Up *__p, _Args &&... __args)
  • construct at pointer β€” template<typename... _Args> void construct (pointer __p, _Args &&... __args)
  • deallocate β€” void deallocate (pointer __p, size_type __n)
  • templated destroy at _Up * β€” template<typename _Up > void destroy (_Up *__p)
  • destroy at pointer β€” void destroy (pointer __p)
  • max size β€” size_type max_size () const noexcept
  • same-type equality compare β€” bool operator== (const _ExtPtr_allocator &__rarg) const
  • templated equality compare β€” template<typename _Up > bool operator== (const _ExtPtr_allocator< _Up > &__rarg) const

🫢 Friends 🫢

Just one friend, and it's the swap bestie:

  • swap β€” template<typename _Up > void swap (_ExtPtr_allocator< _Up > &, _ExtPtr_allocator< _Up > &)

πŸ”₯ Detailed Description πŸ”₯

The class template is exactly this:

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

And the official description is: "An example allocator which uses a non-standard pointer type." Iconic. This allocator specifies that containers use a 'relative pointer' as it's pointer type. (See ext/pointer.h.) Memory allocation in this example is still performed using std::allocator.


πŸ’– Author πŸ’–

Generated automatically by Doxygen for libstdc++ from the source code. So yes, the author section is literally the Doxygen auto-gen credit. Respect. 🫢


okay bye bestie πŸ’œ source/version footer vibes: libstd__gnu_cxx::_Ex...llocator< _Tp >(3cxx) β€” that's the libstdc++ / 3cxx tag, and there's no separate date printed on the footer, so I'm not making one up. slay. ✨

πŸ“¦ where this page comes from