__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_pointerconst_referenceβtypedef const _Tp & const_referencedifference_typeβtypedef std::ptrdiff_t difference_typepointerβtypedef _Pointer_adapter< _Relative_pointer_impl< _Tp > > pointerreferenceβtypedef _Tp & referencesize_typeβtypedef std::size_t size_typevalue_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
- 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