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

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

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.
