__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_t is the difference type. ✨
  • typedef _Pointer_adapter< _Relative_pointer_impl< _Tp > > pointer β€” the non-const pointer type, same _Pointer_adapter vibe but for _Tp. πŸ¦‹
  • typedef _Tp & reference β€” ref to _Tp. 🌸
  • typedef std::size_t size_type β€” size type is std::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's noexcept. 🫢
  • template<typename _Up> _ExtPtr_allocator (const _ExtPtr_allocator< _Up > &__rarg) noexcept β€” converting constructor from _ExtPtr_allocator< _Up >, also noexcept. πŸ’œ
  • const std::allocator< _Tp > & _M_getUnderlyingImp () const β€” returns the underlying std::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 __x as a const_pointer, noexcept. ✨
  • pointer address (reference __x) const noexcept β€” hands you the address of __x as a pointer, noexcept. 🌈
  • pointer allocate (size_type __n, const void *=0) β€” allocates __n things; the second param is const void * and defaults to 0. πŸ‘‘
  • template<typename _Up, typename... _Args> void construct (_Up *__p, _Args &&... __args) β€” constructs at _Up *__p using _Args &&... __args. πŸŽ€
  • template<typename... _Args> void construct (pointer __p, _Args &&... __args) β€” constructs at pointer __p using _Args &&... __args. πŸ’–
  • void deallocate (pointer __p, size_type __n) β€” deallocates __n things at pointer __p. πŸ’…
  • template<typename _Up> void destroy (_Up *__p) β€” destroys the thing at _Up *__p. 🌸
  • void destroy (pointer __p) β€” destroys the thing at pointer __p. πŸ¦‹
  • size_type max_size () const noexcept β€” returns max size as size_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 > &) β€” friend swap for 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