#include <stdcontainerma.hpp>
Implementation of std::allocator
to be used with container types provided by the C++ standard library.
As the C+++ library's specification does not include details of the container class's implementation, this allocator uses type util::RTTRAllocator which detects node types automatically.
T | The type of objects to be allocated. |
Definition at line 501 of file stdcontainerma.hpp.
Inner Classes | |
struct | rebind |
Public Fields | |
RTTRAllocator & | recycler |
Public Methods | |
constexpr | StdContMARecycling (const StdContMARecycling &) noexcept=default |
constexpr | StdContMARecycling (RTTRAllocator &pRecycler) |
constexpr | StdContMARecycling (StdContMARecycling &&) noexcept=default |
template<typename TSibling > | |
StdContMARecycling (TSibling &StdContMARecycling) | |
ALIB_NODISCARD T * | allocate (size_t n, const void *=nullptr) |
void | deallocate (T *p, std::size_t n) |
template<typename U > | |
bool | operator!= (const StdContMARecycling< U > &rhs) const noexcept |
template<typename U > | |
bool | operator== (const StdContMARecycling< U > &rhs) const noexcept |
![]() | |
const_pointer | address (const_reference x) const noexcept |
pointer | address (reference x) const noexcept |
template<typename U , typename... Args> | |
void | construct (U *p, Args &&... args) |
template<typename U > | |
void | destroy (U *p) |
size_t | max_size () const noexcept |
Additional Inherited Members | |
![]() | |
using | const_pointer = const T * |
using | const_reference = const T & |
using | difference_type = ptrdiff_t |
Type definition as required by C++ library standards. | |
using | is_always_equal = std::false_type |
Type definition as required by C++ library standards. | |
using | pointer = T * |
using | reference = T & |
using | size_type = size_t |
Type definition as required by C++ library standards. | |
using | value_type = T |
Type definition as required by C++ library standards. | |
|
constexprdefaultnoexcept |
Defaulted copy constructor
|
constexprdefaultnoexcept |
Defaulted move constructor
|
inline |
Copy constructor using an instance of different template type.
TSibling | The originating allocator's type (StdContMARecycling<X>). |
StdContMARecycling | The originating allocator of type TSibling . |
Definition at line 541 of file stdcontainerma.hpp.
|
inlineconstexpr |
Constructor for the initial allocator instantiation.
pRecycler | The recycler to for allocations and de-allocations. |
Definition at line 549 of file stdcontainerma.hpp.
|
inline |
Implementation of std::allocator
interface. Dependent on whether a single or multiple objects are requested, this method invokes either RTTRAllocator::Get or RTTRAllocator::AllocUnrelated on field recycler.
n | The number of requested objects to allocate storage for. |
Definition at line 594 of file stdcontainerma.hpp.
|
inline |
Implementation of std::allocator
interface. Dependent on whether a single or multiple objects are de-allocated (parameter n), this method invokes either RTTRAllocator::Recycle or RTTRAllocator::RecycleChunk on field recycler.
p | Pointer to the object to deallocate. |
n | The number of objects to de-allocate. |
Definition at line 613 of file stdcontainerma.hpp.
|
inlinenoexcept |
Comparison operator.
U | The allocation type of the other allocator. |
rhs | The right hand side allocator. |
false
if this and rhs use the same recycler, true
otherwise. Definition at line 575 of file stdcontainerma.hpp.
|
inlinenoexcept |
Comparison operator.
U | The allocation type of the other allocator. |
rhs | The right hand side allocator. |
true
if this and rhs use the same recycler, false
otherwise. Definition at line 563 of file stdcontainerma.hpp.
RTTRAllocator& recycler |
The only member of this allocator type used to perform all duties.
Definition at line 524 of file stdcontainerma.hpp.