8#ifndef HPP_ALIB_MONOMEM_STDCONTAINERMA
9#define HPP_ALIB_MONOMEM_STDCONTAINERMA
11#if !defined(HPP_ALIB_MONOMEM_UTIL_RTTRALLOCATOR)
15#if !defined(HPP_ALIB_LANG_SIDILIST)
19namespace alib {
namespace monomem {
43 #if ALIB_CPP_STANDARD == 17 || defined(ALIB_DOX)
51 return static_cast<size_t>(-1) / 2;
136 template<typename TSibling>
174 template<
typename U >
186 template<
typename U >
206 DBG_MONOMEM_VERBOSE(
"STD_CONTAINER",
"Allocating object of type {!Q<>}. ",
typeid(T) )
221 "De-allocation with strict allocator. If this is container destruction, set flag\n"
222 "StdContMA::dbgDeallocationWarning to disable this warning. " )
274 template<typename TSibling>
312 template<
typename U >
324 template<
typename U >
345 DBG_MONOMEM_VERBOSE(
"STD_CONTAINER",
"Allocating object of type {!Q<>}. "
346 "Optional allocator set: ",
347 typeid(T), (
allocator ==
nullptr ?
"No" :
"Yes") )
350 return reinterpret_cast<T*
>( std::malloc(
sizeof(T) * n ) );
370 "De-allocation with strict allocator. If this is container destruction, set flag\n"
371 "StdContMAOptional::dbgDeallocationWarning to disable this warning. " )
421 template<typename TSibling>
443 template<
typename U >
455 template<
typename U >
478 return reinterpret_cast<T*
>(
recycler.
Get(
sizeof(T) ,
alignof(T)
ALIB_FORCE_INLINE T * AllocArray(TSize length)
#define ALIB_ASSERT_WARNING(cond,...)
bool dbgDeallocationWarning
void deallocate(T *p, std::size_t n)
constexpr StdContMAOptional(const StdContMAOptional &) noexcept=default
bool operator!=(const StdContMAOptional< U > &rhs) const noexcept
constexpr StdContMAOptional()
MonoAllocator * allocator
T * allocate(size_t n, const void *=nullptr)
constexpr StdContMAOptional(StdContMAOptional &&) noexcept=default
constexpr StdContMAOptional(MonoAllocator &pAllocator, bool dbgDeallocationWarning=true)
bool operator==(const StdContMAOptional< U > &rhs) const noexcept
void deallocate(T *p, std::size_t n)
constexpr StdContMARecycling(RTTRAllocator &pRecycler)
constexpr StdContMARecycling(const StdContMARecycling &) noexcept=default
bool operator==(const StdContMARecycling< U > &rhs) const noexcept
bool operator!=(const StdContMARecycling< U > &rhs) const noexcept
constexpr StdContMARecycling(StdContMARecycling &&) noexcept=default
T * allocate(size_t n, const void *=nullptr)
constexpr StdContMA(const StdContMA &) noexcept=default
bool dbgDeallocationWarning
bool operator==(const StdContMA< U > &rhs) const noexcept
void deallocate(T *p, std::size_t n)
bool operator!=(const StdContMA< U > &rhs) const noexcept
constexpr StdContMA(MonoAllocator &pAllocator, bool dbgDeallocationWarning=true)
T * allocate(size_t n, const void *=nullptr)
MonoAllocator & allocator
constexpr StdContMA(StdContMA &&) noexcept=default
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.
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.
char * AllocUnrelated(size_t size, size_t alignment, const type_info &dbgTypeInfo)
char * Get(size_t size, size_t alignment, const type_info &dbgTypeInfo)
void RecycleChunk(char *mem, size_t size, size_t alignment, const type_info &dbgTypeInfo)
void Recycle(void *mem, size_t size, size_t alignment, const type_info &dbgTypeInfo)