__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_type
  • typedef std::true_type propagate_on_container_move_assignment
  • typedef std::size_t size_type
  • typedef _Tp value_type

πŸ¦‹ Public Member Functions πŸ¦‹

here's what it can actually do:

  • new_allocator (const new_allocator &) noexcept
  • template<typename _Tp1> new_allocator (const new_allocator< _Tp1 > &) noexcept
  • constexpr _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 from new even if the library has been configured to use a different implementation for std::allocator. so if your libstdc++ got customized and you specifically need new, 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