libstdc++: std::pmr::polymorphic_allocator< _Tp > Class Template Reference

libstdc++

std::pmr::polymorphic_allocator< _Tp > Class Template Reference
Utilities » Memory » Polymorphic memory resources

`#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

Definition at line 123 of file memory_resource.h.

## Member Typedef Documentation

## ◆ value_type

template<typename _Tp>

using std::pmr::polymorphic_allocator< _Tp >::value_type

Definition at line 134 of file memory_resource.h.

## Constructor & Destructor Documentation

## ◆ polymorphic_allocator() [1/3]

template<typename _Tp>

std::pmr::polymorphic_allocator< _Tp >::polymorphic_allocator | ( |  | ) |
| inlinenoexcept

Definition at line 136 of file memory_resource.h.

## ◆ polymorphic_allocator() [2/3]

template<typename _Tp>

std::pmr::polymorphic_allocator< _Tp >::polymorphic_allocator | ( | memory_resource * | __r | ) |
| inlinenoexcept

Definition at line 143 of file memory_resource.h.

## ◆ polymorphic_allocator() [3/3]

template<typename _Tp>
template<typename _Up>

std::pmr::polymorphic_allocator< _Tp >::polymorphic_allocator | ( | const polymorphic_allocator< _Up > & | __x | ) |
| inlinenoexcept

Definition at line 151 of file memory_resource.h.

## Member Function Documentation

## ◆ allocate()

template<typename _Tp>

_Tp * std::pmr::polymorphic_allocator< _Tp >::allocate | ( | size_t | __n | ) |
| inlinenodiscard

Definition at line 160 of file memory_resource.h.

## ◆ construct()

template<typename _Tp>
template<typename _Tp1, typename... _Args>

void std::pmr::polymorphic_allocator< _Tp >::construct | ( | _Tp1 * | __p,
|  | _Args &&... | __args )
| inline

Definition at line 303 of file memory_resource.h.

## ◆ deallocate()

template<typename _Tp>

void std::pmr::polymorphic_allocator< _Tp >::deallocate | ( | _Tp * | __p,
|  | size_t | __n )
| inlinenoexcept

Definition at line 170 of file memory_resource.h.

## ◆ destroy()

template<typename _Tp>
template<typename _Up>

void std::pmr::polymorphic_allocator< _Tp >::destroy | ( | _Up * | __p | ) |
| inline

Definition at line 313 of file memory_resource.h.

## ◆ resource()

template<typename _Tp>

memory_resource * std::pmr::polymorphic_allocator< _Tp >::resource | ( |  | ) | const
| inlinenoexcept

Definition at line 321 of file memory_resource.h.

## ◆ select_on_container_copy_construction()

template<typename _Tp>

polymorphic_allocator std::pmr::polymorphic_allocator< _Tp >::select_on_container_copy_construction | ( |  | ) | const
| inlinenoexcept

Definition at line 317 of file memory_resource.h.

## Friends And Related Symbol Documentation

## ◆ operator==

template<typename _Tp>

bool operator== | ( | const polymorphic_allocator< _Tp > & | __a,
|  | const polymorphic_allocator< _Tp > & | __b )
| friend

Definition at line 329 of file memory_resource.h.

The documentation for this class was generated from the following file:

- memory_resource.h