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 122 of file memory_resource.h.

## Member Typedef Documentation

## value_type

template<typename _Tp>

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

Definition at line 133 of file memory_resource.h.

## Constructor & Destructor Documentation

## polymorphic_allocator() [1/3]

template<typename _Tp>

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

inline noexcept

Definition at line 135 of file memory_resource.h.

## polymorphic_allocator() [2/3]

template<typename _Tp>

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

inline noexcept

Definition at line 142 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 | ) |

inline noexcept

Definition at line 150 of file memory_resource.h.

## Member Function Documentation

## allocate()

template<typename _Tp>

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

inline nodiscard

Definition at line 159 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 302 of file memory_resource.h.

## deallocate()

template<typename _Tp>

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

inline noexcept

Definition at line 169 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 312 of file memory_resource.h.

## resource()

template<typename _Tp>

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

inline noexcept

Definition at line 320 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

inline noexcept

Definition at line 316 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 328 of file memory_resource.h.

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

- memory_resource.h