---
name: "__gnu_cxx::new_allocator"
section: "3"
platform: "linux"
package: "gcc"
version: "16.2.1+r23+gd564253eb6c8-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/__gnu_cxx::new_allocator"
---

# \_\_gnu\_cxx::new\_allocator(3)

An allocator that uses global new, as per C++03 \[20.4.1\].

## NAME

\_\_gnu\_cxx::new\_allocator\< \_Tp \> - An allocator that uses global new, as per C++03 \[20.4.1\].

## 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

**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

### 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.

- •

  all allocation calls operator new

- •

  all deallocation calls operator delete

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.

**Template Parameters**

*\_Tp* Type of allocated object.

## Author

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