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

`#include <memory_resource>`

## Public Types

using | value_type = _Tp

## 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)
void * | allocate_bytes (size_t __nbytes, size_t __alignment=alignof(max_align_t))
template<typename _Up >
_Up * | allocate_object (size_t __n=1)
template<typename _Tp1 , typename... _Args>
void | construct (_Tp1 *__p, _Args &&... __args)
void | deallocate (_Tp *__p, size_t __n) noexcept
void | deallocate_bytes (void *__p, size_t __nbytes, size_t __alignment=alignof(max_align_t))
template<typename _Up >
void | deallocate_object (_Up *__p, size_t __n=1)
template<typename _Up >
void | delete_object (_Up *__p)
template<typename _Up >
void | destroy (_Up *__p)
template<typename _Up , typename... _CtorArgs>
_Up * | new_object (_CtorArgs &&... __ctor_args)
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 120 of file memory_resource.h.

## Member Typedef Documentation

## value_type

template<typename _Tp >

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

Definition at line 131 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 133 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 140 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 148 of file memory_resource.h.

## Member Function Documentation

## allocate()

template<typename _Tp >

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

inline

Definition at line 157 of file memory_resource.h.

## allocate_bytes()

template<typename _Tp >

void * std::pmr::polymorphic_allocator< _Tp >::allocate_bytes | ( | size_t | __nbytes,
|  | size_t | __alignment = `alignof(max_align_t)`
| ) |  |

inline

Definition at line 173 of file memory_resource.h.

## allocate_object()

template<typename _Tp >
template<typename _Up >

_Up * std::pmr::polymorphic_allocator< _Tp >::allocate_object | ( | size_t | __n = `1` | ) |

inline

Definition at line 184 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 300 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 167 of file memory_resource.h.

## deallocate_bytes()

template<typename _Tp >

void std::pmr::polymorphic_allocator< _Tp >::deallocate_bytes | ( | void * | __p,
|  | size_t | __nbytes,
|  | size_t | __alignment = `alignof(max_align_t)`
| ) |  |

inline

Definition at line 178 of file memory_resource.h.

## deallocate_object()

template<typename _Tp >
template<typename _Up >

void std::pmr::polymorphic_allocator< _Tp >::deallocate_object | ( | _Up * | __p,
|  | size_t | __n = `1`
| ) |  |

inline

Definition at line 194 of file memory_resource.h.

## delete_object()

template<typename _Tp >
template<typename _Up >

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

inline

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

## new_object()

template<typename _Tp >
template<typename _Up , typename... _CtorArgs>

_Up * std::pmr::polymorphic_allocator< _Tp >::new_object | ( | _CtorArgs &&... | __ctor_args | ) |

inline

Definition at line 199 of file memory_resource.h.

## resource()

template<typename _Tp >

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

inline noexcept

Definition at line 319 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 315 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 327 of file memory_resource.h.

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

- memory_resource.h