__GNU_CXX::NEW_ALLOCATOR(3)
π __gnu_cxx::new_allocator< _Tp > β NAME π
okay bestie, welcome to the Library Functions Manual entry for __gnu_cxx:...ator< _Tp >(3), and let me just say β this one is giving allocator, but make it β¨classicβ¨.
So, the NAME of the whole thing: __gnu_cxx::new_allocator< _Tp > β an allocator that uses global new, as per C++03 [20.4.1]. That's it, that's the vibe. π
β¨ SYNOPSIS β¨
Pull it in like this, bestie:
#include <ext/new_allocator.h>
Oh and also? It Inherits std::__new_allocator< _Tp >. Yes, it's a nepo baby. And we love that for it. π
πΈ Public Types πΈ
the type list, no notes:
typedef std::ptrdiff_t difference_typetypedef std::true_type propagate_on_container_move_assignmenttypedef std::size_t size_typetypedef _Tp value_type
π¦ Public Member Functions π¦
here's what it can actually do:
new_allocator (const new_allocator &) noexcepttemplate<typename _Tp1> new_allocator (const new_allocator< _Tp1 > &) noexceptconstexpr _Tp * allocate (size_type __n, const void *=static_cast< const void * >(0))constexpr void deallocate (_Tp *__p, size_type __n)
π Detailed Description π
okay so picture this:
template<typename _Tp>
class __gnu_cxx::new_allocator< _Tp >
An allocator that uses global new, as per C++03 [20.4.1].
This is precisely the allocator defined in the C++ Standard. Like, the standard one. The blueprint. The main character. β
- all allocation calls
operator new - all deallocation calls
operator delete
That's the whole personality: new in, delete out, no cap.
and here's the tea π β this is a non-standard extension that can be used to guarantee allocation fromneweven if the library has been configured to use a different implementation forstd::allocator. so if your libstdc++ got customized and you specifically neednew, this is your girl. no guessing, that's literally what it's for.
π§ Template Parameters π§
_Tpβ Type of allocated object. (that's the thing you're allocating, bestie. that's the whole parameter.)
π Author π
Generated automatically by Doxygen for libstdc++ from the source code. so nobody hand-wrote this one, it just manifested.
and that's the page, periodt. π
this whole manual page came to you from libstdc++ (that's the source/version, bestie, straight off the footer), filed under __gnu_cxx:...ator< _Tp >(3), and it was auto-generated from the source code so you know it's fr fr accurate. mwah, go allocate something cute π«Άβ¨π
π¦ 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