25#ifndef COUNTING_ALLOCATOR_HPP
26#define COUNTING_ALLOCATOR_HPP
77 constexpr void flush_stats() noexcept {
101#if __cplusplus > 201703L
103 : std::allocator<value_type>(other),
112 : std::allocator<value_type>(other),
121#if __cplusplus > 201703L
122 template <
typename U>
124 : std::allocator<value_type>(other),
132 template <
typename U>
134 : std::allocator<value_type>(other),
143#if __cplusplus > 201703L
149#if __cplusplus <= 201703L
155 return std::allocator<value_type>::allocate(n, hint);
159#if __cplusplus > 201703L
165 return std::allocator<value_type>::allocate(n);
173 return std::allocator<value_type>::allocate(n);
177#if __cplusplus > 201703L
183 std::allocator<value_type>::deallocate(p, n);
191 std::allocator<value_type>::deallocate(p, n);
196#if __cplusplus > 201703L
197template <
class T1,
class T2>
198 constexpr bool operator==(
const counting_allocator<T1>& lhs,
const counting_allocator<T2>& rhs)
noexcept {
203 return lhs.memory_usage == rhs.memory_usage;
211 template <
class T1,
class T2>
217 return lhs.memory_usage == rhs.memory_usage;
224 template <
class T1,
class T2>
uint_fast32_t nsize_t
Natural 'size_t' alternative using uint_fast32_t as its natural sized type.
std::string to_decstring(const value_type &v, const char separator=',', const nsize_t width=0) noexcept
Produce a decimal string representation of an integral integer value.
__pack(...): Produces MSVC, clang and gcc compatible lead-in and -out macros.
bool operator==(const callocator< T1 > &lhs, const callocator< T2 > &rhs) noexcept
bool operator!=(const callocator< T1 > &lhs, const callocator< T2 > &rhs) noexcept
counting_allocator< U > other
Performance counter std::allocator specialization.
value_type * allocate(std::size_t n)
void deallocate(value_type *p, std::size_t n)
std::size_t dealloc_count
counting_allocator() noexcept
counting_allocator(const counting_allocator &other) noexcept
~counting_allocator()=default
value_type * allocate(std::size_t n, const void *hint)
counting_allocator(const counting_allocator< U > &other) noexcept
std::string toString(const nsize_t mem_width=0, const nsize_t count_width=0)