25#ifndef C_ALLOCATOR_SEC_HPP
26#define C_ALLOCATOR_SEC_HPP
50 std::enable_if_t< std::is_integral_v<T>,
bool> =
true>
71 typedef std::remove_const_t<T> value_type_mutable;
73 typedef value_type_mutable* pointer_mutable;
78#if __cplusplus > 201703L
86#if __cplusplus > 201703L
96#if __cplusplus > 201703L
102#if __cplusplus <= 201703L
108#if __cplusplus > 201703L
118#if __cplusplus > 201703L
120 ::explicit_bzero(p, n);
121 ::free(
reinterpret_cast<void*
>(
const_cast<pointer_mutable
>(p) ) );
125 ::explicit_bzero(p, n);
126 ::free(
reinterpret_cast<void*
>(
const_cast<pointer_mutable
>(p) ) );
133#if __cplusplus > 201703L
134template <
class T1,
class T2>
135 constexpr bool operator==(
const callocator_sec<T1>& lhs,
const callocator_sec<T2>& rhs)
noexcept {
140 return lhs.memory_usage == rhs.memory_usage;
148 template <
class T1,
class T2>
154 return lhs.memory_usage == rhs.memory_usage;
161 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
callocator_sec< U > other
A simple secure allocator for integral types using POSIX C functions: ::malloc() and ::free().
std::true_type is_always_equal
std::ptrdiff_t difference_type
void deallocate(value_type *p, std::size_t n)
value_type * allocate(std::size_t n)
std::true_type propagate_on_container_move_assignment
callocator_sec(const callocator_sec< U > &) noexcept
~callocator_sec()=default
callocator_sec() noexcept=default
const T & const_reference
value_type * allocate(std::size_t n, const void *)
callocator_sec(const callocator_sec &) noexcept