__GNU_CXX::NEW_ALLOCATOR(3cxx)

πŸ’– NAME πŸ’–

okay so bestie, welcome to the __gnu_cxx::new_allocator< _Tp > page from the 3cxx manual β€” and it is literally An allocator that uses global new, as per C++03 [20.4.1]. periodt πŸ’…


✨ SYNOPSIS ✨

#include <ext/new_allocator.h>

Inherits std::__new_allocator< _Tp >.

πŸŽ€ Public Types πŸŽ€

  • 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 πŸ¦‹

  • the copy-constructor cutie:
new_allocator (const new_allocator &) noexcept
  • converting constructor from another new_allocator< _Tp1 >:
template<typename _Tp1 > new_allocator (const new_allocator< _Tp1 > &)
           noexcept
  • the allocate member β€” exact signature, no cap:
_Tp * allocate (size_type __n, const void *=static_cast< const void *
           >(0))
  • the deallocate member: void deallocate (_Tp *__p, size_type __n)

🌈 Detailed Description 🌈

template<typename _Tp>
class __gnu_cxx::new_allocator< _Tp >

This one is described as: An allocator that uses global new, as per C++03 [20.4.1].

It is precisely the allocator defined in the C++ Standard. like, exactly that one πŸ’–

  • all allocation calls operator new
  • all deallocation calls operator delete
🚨 caveat bestie: 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. highkey important, don't sleep on that πŸ’€

πŸ’œ Template Parameters πŸ’œ

  • _Tp β€” Type of allocated object.

🫢 Author 🫢

Generated automatically by Doxygen for libstdc++ from the source code.


source/version: libstdc++; footer tag: __gnu_cxx::new_allocator< _Tp >(3cxx); date: not shown on the page. that's the whole manual-page slay, bestie β€” mwah πŸ’‹βœ¨πŸ¦‹