---
name: "__gnu_cxx::debug_allocator"
section: "3cxx"
platform: "linux"
package: "libstdc++-12-doc"
version: "12.4.0-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/__gnu_cxx::debug_allocator/3cxx"
---

# \_\_gnu\_cxx::debug\_allocator(3cxx)

A meta-allocator with debugging bits.

## NAME

\_\_gnu\_cxx::debug\_allocator\< \_Alloc \> - A meta-allocator with debugging bits.

## SYNOPSIS

`#include <debug_allocator.h>`

### Public Types

typedef \_Traits::const\_pointer **const\_pointer**\
 typedef \_Traits::const\_reference **const\_reference**\
 typedef \_Traits::difference\_type **difference\_type**\
 typedef **\_Traits::pointer** **pointer**\
 typedef \_Traits::reference **reference**\
 typedef \_Traits::size\_type **size\_type**\
 typedef \_Traits::value\_type **value\_type**\

### Public Member Functions

**debug\_allocator** (const \_Alloc &\_\_a)\
 template\<typename \_Alloc2 \> **debug\_allocator** (const **debug\_allocator**\< \_Alloc2 \> &\_\_a2, typename \_\_convertible\< \_Alloc2 \>::\_\_type=0)\
 **pointer** **allocate** (size\_type \_\_n)\
 **pointer** **allocate** (size\_type \_\_n, const void \*\_\_hint)\
 template\<typename \_Tp , typename... \_Args\> void **construct** (\_Tp \*\_\_p, \_Args &&... \_\_args)\
 void **construct** (**pointer** \_\_p, const value\_type &\_\_val)\
 void **deallocate** (**pointer** \_\_p, size\_type \_\_n)\
 template\<typename \_Tp \> void **destroy** (\_Tp \*\_\_p)\
 size\_type **max\_size** () const  throw ()\

### Friends

template\<typename \_Alloc2 \> bool **operator==** (const **debug\_allocator** &\_\_lhs, const **debug\_allocator**\< \_Alloc2 \> &\_\_rhs) noexcept\

## Detailed Description

### template\<typename \_Alloc\>

class \_\_gnu\_cxx::debug\_allocator\< \_Alloc \>"A meta-allocator with debugging bits.

This is precisely the allocator defined in the C++03 Standard.

## Author

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