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 399 of file stdcontainerma.hpp.
#include <stdcontainerma.hpp>
Public Field Index: | |
| RTTRAllocator & | recycler |
Public Method Index: | |
| constexpr | StdContMARecycling (const StdContMARecycling &) noexcept=default |
| constexpr | StdContMARecycling (RTTRAllocator &pRecycler) |
| constexpr | StdContMARecycling (StdContMARecycling &&) noexcept=default |
| template<typename TSibling > | |
| StdContMARecycling (TSibling &StdContMARecycling) | |
| 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 |
Public Method Index: inherited from StdContainerMABase< T > | |
| size_t | max_size () const noexcept |
Additional Inherited Members | |
Public Type Index: inherited from StdContainerMABase< 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 | size_type = size_t |
| Type definition as required by C++ library standards. | |
| using | value_type = T |
| Type definition as required by C++ library standards. | |
| RTTRAllocator& recycler |
The only member of this allocator type used to perform all duties.
Definition at line 405 of file stdcontainerma.hpp.
|
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 422 of file stdcontainerma.hpp.
|
inlineconstexpr |
Constructor for the initial allocator instantiation.
| pRecycler | The recycler to for allocations and de-allocations. |
Definition at line 430 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 475 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 494 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 456 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 444 of file stdcontainerma.hpp.