Standard library compatible allocator with policies.
More...
#include <mckl/core/memory.hpp>
Inherits std::allocator< T >.
|
| | Allocator ()=default |
| |
| template<typename U > |
| | Allocator (const Allocator< U, Mem > &other) noexcept |
| |
| T * | allocate (std::size_t n, const void *hint=nullptr) |
| |
| template<typename U > |
| void | construct (U *p) |
| |
| void | deallocate (T *ptr, std::size_t size=0) noexcept(noexcept(Mem::deallocate(ptr, size))) |
| |
|
(Note that these are not member functions.)
|
| template<typename T1 , typename T2 , typename Mem1 , typename Mem2 > |
| constexpr bool | operator!= (const Allocator< T1, Mem1 > &, const Allocator< T2, Mem2 > &) |
| |
| template<typename T1 , typename T2 , typename Mem1 , typename Mem2 > |
| constexpr bool | operator== (const Allocator< T1, Mem1 > &, const Allocator< T2, Mem2 > &) |
| |
template<typename T, typename Mem = Memory<AlignOf<T>>>
class mckl::Allocator< T, Mem >
Standard library compatible allocator with policies.
- Template Parameters
-
| T | The value type |
| Mem | The memory allocation policy |
- See also
- Allocator<void, Mem>
-
Allocator<const void, Mem>
-
std::allocator
Definition at line 322 of file memory.hpp.
◆ Allocator() [1/2]
template<typename T, typename Mem = Memory<AlignOf<T>>>
◆ Allocator() [2/2]
template<typename T, typename Mem = Memory<AlignOf<T>>>
template<typename U >
◆ allocate()
template<typename T, typename Mem = Memory<AlignOf<T>>>
| T* mckl::Allocator< T, Mem >::allocate |
( |
std::size_t |
n, |
|
|
const void * |
hint = nullptr |
|
) |
| |
|
inline |
◆ construct()
template<typename T, typename Mem = Memory<AlignOf<T>>>
template<typename U >
◆ deallocate()
template<typename T, typename Mem = Memory<AlignOf<T>>>
| void mckl::Allocator< T, Mem >::deallocate |
( |
T * |
ptr, |
|
|
std::size_t |
size = 0 |
|
) |
| |
|
inlinenoexcept |
◆ operator!=()
template<typename T1 , typename T2 , typename Mem1 , typename Mem2 >
| constexpr bool operator!= |
( |
const Allocator< T1, Mem1 > & |
, |
|
|
const Allocator< T2, Mem2 > & |
|
|
) |
| |
|
related |
◆ operator==()
template<typename T1 , typename T2 , typename Mem1 , typename Mem2 >
| constexpr bool operator== |
( |
const Allocator< T1, Mem1 > & |
, |
|
|
const Allocator< T2, Mem2 > & |
|
|
) |
| |
|
related |