25#ifndef C_ALLOCATOR_HPP
26#define C_ALLOCATOR_HPP
69 typedef std::remove_const_t<T> value_type_mutable;
71 typedef value_type_mutable* pointer_mutable;
76#if __cplusplus > 201703L
84#if __cplusplus > 201703L
94#if __cplusplus > 201703L
100#if __cplusplus <= 201703L
106#if __cplusplus > 201703L
118 ::realloc(
reinterpret_cast<void*
>(
const_cast<pointer_mutable
>(p)), new_size *
sizeof(
value_type) ) );
121#if __cplusplus > 201703L
123 ::free(
reinterpret_cast<void*
>(
const_cast<pointer_mutable
>( p ) ) );
127 ::free(
reinterpret_cast<void*
>(
const_cast<pointer_mutable
>( p ) ) );
134#if __cplusplus > 201703L
135template <
class T1,
class T2>
136 constexpr bool operator==(
const callocator<T1>& lhs,
const callocator<T2>& rhs)
noexcept {
141 return lhs.memory_usage == rhs.memory_usage;
149 template <
class T1,
class T2>
155 return lhs.memory_usage == rhs.memory_usage;
162 template <
class T1,
class T2>
__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
A simple allocator using POSIX C functions: ::malloc(), ::free() and ::realloc().
std::true_type is_always_equal
callocator() noexcept=default
callocator(const callocator &) noexcept
constexpr value_type * reallocate(value_type *p, std::size_t, std::size_t new_size)
std::ptrdiff_t difference_type
callocator(const callocator< U > &) noexcept
const T & const_reference
value_type * allocate(std::size_t n)
value_type * allocate(std::size_t n, const void *)
std::true_type propagate_on_container_move_assignment
void deallocate(value_type *p, std::size_t)