9#ifndef HPP_ALIB_LANG_STDCONTAINERALLOCATOR
10#define HPP_ALIB_LANG_STDCONTAINERALLOCATOR
25template<
typename T,
typename TAllocator>
45 #if ALIB_CPP_STANDARD == 17 || DOXYGEN
51 return size_t(-1) / 2;
106template<
typename T,
typename TAllocator>
122 template<typename TSibling, typename TEnableIf=
131 template<
typename TSibling>
153 template<
typename U >
156 return &allocBase::getAllocator() == &rhs.getAllocator();
163 template<
typename U >
215template<
typename T,
typename TAllocator>
236 template<typename TSibling>
253 template<
typename U >
255 {
return recycler == rhs.recycler; }
261 template<
typename U >
263 {
return recycler != rhs.recycler; }
281 return reinterpret_cast<T*
>(
recycler.Get(
sizeof(T),
285 return reinterpret_cast<T*
>(
recycler.AllocUnrelated(
sizeof(T) * n,
302 if( n == 1 )
recycler.Recycle( p,
sizeof(T) ,
alignof(T)
ALIB_DBG(,
typeid(T) ) );
#define ATMP_ISOF( T, TBase)
#define ATMP_T_IF(T, Cond)
AllocatorInterface< TAllocator > AI() const noexcept
TAllocator & GetAllocator() const noexcept
TAllocator & allocator
A reference to the allocator.
constexpr StdContainerAllocatorRecycling(StdContainerAllocatorRecycling &&) noexcept=default
Defaulted move constructor.
void deallocate(T *p, std::size_t n)
bool operator!=(const StdContainerAllocatorRecycling< U, TAllocator > &rhs) const noexcept
RTTRAllocator< TAllocator > & recycler
The only member of this allocator type used to perform all duties.
constexpr StdContainerAllocatorRecycling(const StdContainerAllocatorRecycling &) noexcept=default
Defaulted copy constructor.
bool operator==(const StdContainerAllocatorRecycling< U, TAllocator > &rhs) const noexcept
T * allocate(size_t n, const void *=nullptr)
constexpr StdContainerAllocatorRecycling(RTTRAllocator< TAllocator > &pRecycler)
void deallocate(T *p, std::size_t n)
constexpr StdContainerAllocator(const StdContainerAllocator &) noexcept=default
Defaulted copy constructor.
StdContainerAllocator()=default
Parameterless constructor used with heap allocation.
constexpr StdContainerAllocator(StdContainerAllocator &&) noexcept=default
Defaulted move constructor.
StdContainerAllocator(TAllocator &pAllocator)
bool operator!=(const StdContainerAllocator< U, TAllocator > &rhs) const noexcept
T * allocate(size_t n, const void *=nullptr)
bool operator==(const StdContainerAllocator< U, TAllocator > &rhs) const noexcept
StdContainerAllocator(const StdContainerAllocator< TSibling, TAllocator > &origin)
T & reference
Type definition as required by C++ library standards.
TAllocator AllocatorType
The allocator type that TAllocator specifies.
T value_type
Type definition as required by C++ library standards.
std::false_type is_always_equal
Type definition as required by C++ library standards.
const T & const_reference
Type definition as required by C++ library standards.
size_t max_size() const noexcept
ptrdiff_t difference_type
Type definition as required by C++ library standards.
size_t size_type
Type definition as required by C++ library standards.