---
name: "std::pmr_polymorphic_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/std::pmr_polymorphic_allocator"
---

# std::pmr\_polymorphic\_allocator(3)

Class template polymorphic\_allocator.

## NAME

std::pmr::polymorphic\_allocator\< \_Tp \> - Class template polymorphic\_allocator.

## SYNOPSIS

\#include \<memory\_resource\>

### Public Types

using **value\_type**\

### Public Member Functions

**polymorphic\_allocator** (const polymorphic\_allocator &\_\_other)=default\
 template\<typename \_Up\> **polymorphic\_allocator** (const polymorphic\_allocator\< \_Up \> &\_\_x) noexcept\
 **polymorphic\_allocator** (**memory\_resource** \*\_\_r) noexcept\
 \_Tp \* **allocate** (size\_t \_\_n)\
 template\<typename \_Tp1, typename... \_Args\> void **construct** (\_Tp1 \*\_\_p, \_Args &&... \_\_args)\
 void **deallocate** (\_Tp \*\_\_p, size\_t \_\_n) noexcept\
 template\<typename \_Up\> void **destroy** (\_Up \*\_\_p)\
 polymorphic\_allocator & **operator=** (const polymorphic\_allocator &)=delete\
 **memory\_resource** \* **resource** () const noexcept\
 polymorphic\_allocator **select\_on\_container\_copy\_construction** () const noexcept\

### Friends

bool **operator==** (const polymorphic\_allocator &\_\_a, const polymorphic\_allocator &\_\_b) noexcept\

## Detailed Description

### template\<typename \_Tp\>

class std::pmr::polymorphic\_allocator\< \_Tp \>"Class template polymorphic\_allocator.

**Since**

C++17

## Author

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