---
name: "__gnu_cxx::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::allocator"
---

# \_\_gnu\_cxx::allocator(3)

The standard allocator, as per C++03 \[20.4.1\].

## NAME

\_\_gnu\_cxx::allocator\< \_Tp \> - The *standard* allocator, as per C++03 \[20.4.1\].

## SYNOPSIS

\#include \<memory\>

Inherits **std::\_\_new\_allocator\< \_Tp \>**.

### Public Types

typedef ptrdiff\_t **difference\_type**\
 using **propagate\_on\_container\_move\_assignment**\
 typedef size\_t **size\_type**\
 typedef \_Tp **value\_type**\

### Public Member Functions

constexpr **allocator** (const allocator &\_\_a) noexcept\
 template\<typename \_Tp1\> constexpr **allocator** (const allocator\< \_Tp1 \> &) noexcept\
 constexpr \_Tp \* **allocate** (size\_t \_\_n)\
 constexpr \_Tp \* **allocate** (size\_type \_\_n, const void \*=static\_cast\< const void \* \>(0))\
 constexpr allocation\_result\< \_Tp \*, size\_t \> **allocate\_at\_least** (size\_t \_\_n)\
 constexpr void **deallocate** (\_Tp \*\_\_p, size\_t \_\_n)\
 allocator & **operator=** (const allocator &)=default\

### Friends

constexpr bool **operator==** (const allocator &, const allocator &) noexcept\

### Related Symbols

(Note that these are not member symbols.)  template\<typename \_T1, typename \_T2\> constexpr bool **operator==** (const allocator\< \_T1 \> &, const allocator\< \_T2 \> &) noexcept\

## Detailed Description

### template\<typename \_Tp\>

class \_\_gnu\_cxx::allocator\< \_Tp \>"The *standard* allocator, as per C++03 \[20.4.1\].

See https://gcc.gnu.org/onlinedocs/libstdc++/manual/memory.html#std.util.memory.allocator for further details.

**Template Parameters**

*\_Tp* Type of allocated object.

## Author

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