__GNU_CXX::_EXTPTR_ALLOCATOR(3)
hey bestie! welcome to the __gnu_cxx::_ExtPtr_allocator< _Tp >(3) page from the Library Functions Manual πβ¨
π NAME π
okay so bestie, meet __gnu_cxx::_ExtPtr_allocator< _Tp > β an example allocator which uses a non-standard pointer type. it's giving "allocator but make it extra" π
no cap.
π¦ SYNOPSIS π¦
to even get this party started, include the header like this:
#include <extptr_allocator.h>
β¨ Public Types β¨
typedef _Pointer_adapter< _Relative_pointer_impl< const _Tp > > const_pointerβ the const pointer type, built from_Pointer_adapter< _Relative_pointer_impl< const _Tp > >. slay. πtypedef const _Tp & const_referenceβ const ref to_Tp, simple. πtypedef std::ptrdiff_t difference_typeβ yep,std::ptrdiff_tis the difference type. β¨typedef _Pointer_adapter< _Relative_pointer_impl< _Tp > > pointerβ the non-const pointer type, same_Pointer_adaptervibe but for_Tp. π¦typedef _Tp & referenceβ ref to_Tp. πΈtypedef std::size_t size_typeβ size type isstd::size_t. πtypedef _Tp value_typeβ value type is_Tp. π
π«Ά Public Member Functions π«Ά
_ExtPtr_allocator (const _ExtPtr_allocator &__rarg) noexceptβ copy constructor from another_ExtPtr_allocator, and it'snoexcept. π«Άtemplate<typename _Up> _ExtPtr_allocator (const _ExtPtr_allocator< _Up > &__rarg) noexceptβ converting constructor from_ExtPtr_allocator< _Up >, alsonoexcept. πconst std::allocator< _Tp > & _M_getUnderlyingImp () constβ returns the underlyingstd::allocator< _Tp >as a const ref. that's the one actually doing the memory work, per the detailed description. π₯const_pointer address (const_reference __x) const noexceptβ hands you the address of const__xas aconst_pointer,noexcept. β¨pointer address (reference __x) const noexceptβ hands you the address of__xas apointer,noexcept. πpointer allocate (size_type __n, const void *=0)β allocates__nthings; the second param isconst void *and defaults to0. πtemplate<typename _Up, typename... _Args> void construct (_Up *__p, _Args &&... __args)β constructs at_Up *__pusing_Args &&... __args. πtemplate<typename... _Args> void construct (pointer __p, _Args &&... __args)β constructs atpointer __pusing_Args &&... __args. πvoid deallocate (pointer __p, size_type __n)β deallocates__nthings atpointer __p. πtemplate<typename _Up> void destroy (_Up *__p)β destroys the thing at_Up *__p. πΈvoid destroy (pointer __p)β destroys the thing atpointer __p. π¦size_type max_size () const noexceptβ returns max size assize_type,noexcept. βbool operator== (const _ExtPtr_allocator &__rarg) constβ equality check against another_ExtPtr_allocator. πtemplate<typename _Up> bool operator== (const _ExtPtr_allocator< _Up > &__rarg) constβ templated equality check against_ExtPtr_allocator< _Up >. π₯
π Friends π
template<typename _Up> void swap (_ExtPtr_allocator< _Up > &, _ExtPtr_allocator< _Up > &)β friendswapfor two_ExtPtr_allocator< _Up >refs. iconic. π
π Detailed Description π
template<typename _Tp>
class __gnu_cxx::_ExtPtr_allocator< _Tp >
so basically this allocator specifies that containers use a 'relative pointer' as its pointer type. (See ext/pointer.h for the relative pointer tea.) Memory allocation in this example is still performed using std::allocator. periodt. π
πΈ Author πΈ
Generated automatically by Doxygen for libstdc++ from the source code. not me writing this by hand, Doxygen did it. π€β¨
that's the whole page bestie! source/version: libstdc++. date: not listed on the page. manual page: __gnu_cxx::_ExtPtr_allocator< _Tp >(3). bye ππ¦π
π¦ where this page comes from
- arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 Β· GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
- fedora 44: libstdc++-docs 16.0.1-0.10.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- fedora 44: libstdc++-docs 16.2.1-2.fc44
- fedora 44: libstdc++-docs 16.2.1-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms