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

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

An example allocator which uses a non-standard pointer type.

## NAME

\_\_gnu\_cxx::\_ExtPtr\_allocator\< \_Tp \> - An example allocator which uses a non-standard pointer type.

## SYNOPSIS

\#include \<extptr\_allocator.h\>

### Public Types

typedef **\_Pointer\_adapter**\< **\_Relative\_pointer\_impl**\< const \_Tp \> \> **const\_pointer**\
 typedef const \_Tp & **const\_reference**\
 typedef std::ptrdiff\_t **difference\_type**\
 typedef **\_Pointer\_adapter**\< **\_Relative\_pointer\_impl**\< \_Tp \> \> **pointer**\
 typedef \_Tp & **reference**\
 typedef std::size\_t **size\_type**\
 typedef \_Tp **value\_type**\

### Public Member Functions

**\_ExtPtr\_allocator** (const \_ExtPtr\_allocator &\_\_rarg) noexcept\
 template\<typename \_Up\> **\_ExtPtr\_allocator** (const \_ExtPtr\_allocator\< \_Up \> &\_\_rarg) noexcept\
 const **std::allocator**\< \_Tp \> & **\_M\_getUnderlyingImp** () const\
 const\_pointer **address** (const\_reference \_\_x) const noexcept\
 pointer **address** (reference \_\_x) const noexcept\
 pointer **allocate** (size\_type \_\_n, const void \*=0)\
 template\<typename \_Up, typename... \_Args\> void **construct** (\_Up \*\_\_p, \_Args &&... \_\_args)\
 template\<typename... \_Args\> void **construct** (pointer \_\_p, \_Args &&... \_\_args)\
 void **deallocate** (pointer \_\_p, size\_type \_\_n)\
 template\<typename \_Up\> void **destroy** (\_Up \*\_\_p)\
 void **destroy** (pointer \_\_p)\
 size\_type **max\_size** () const noexcept\
 bool **operator==** (const \_ExtPtr\_allocator &\_\_rarg) const\
 template\<typename \_Up\> bool **operator==** (const \_ExtPtr\_allocator\< \_Up \> &\_\_rarg) const\

### Friends

template\<typename \_Up\> void **swap** (\_ExtPtr\_allocator\< \_Up \> &, \_ExtPtr\_allocator\< \_Up \> &)\

## Detailed Description

### template\<typename \_Tp\>

class \_\_gnu\_cxx::\_ExtPtr\_allocator\< \_Tp \>"An example allocator which uses a non-standard pointer type.

This allocator specifies that containers use a 'relative pointer' as it's pointer type. (See ext/pointer.h) Memory allocation in this example is still performed using std::allocator.

## Author

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