32#ifndef NNGN_UTILS_ALLOC_BASE_H
33#define NNGN_UTILS_ALLOC_BASE_H
40struct allocator_opts {
49template<
typename T, allocator_opts o>
struct allocator_base {};
51template<
typename T, allocator_opts o>
52bool operator==(
const allocator_base<T, o>&,
const allocator_base<T, o>&) {
53 return o.is_always_equal;
56template<
typename T, allocator_opts o>
57bool operator!=(
const allocator_base<T, o>&,
const allocator_base<T, o>&) {
58 return !o.is_always_equal;
84 requires(A
a,
typename A::pointer
p, std::size_t
n) {
93template<
typename A,
typename T>
95 requires(A
a,
typename A::pointer
p, std::size_t
n,
T t) {
n
Definition: dump_lights.lua:5
static constexpr bool has_realloc
Checks whether an allocator supports memory relocation.
Definition: base.h:83
static constexpr bool has_typed_alloc
Checks whether an allocator supports typed memory allocations.
Definition: base.h:94
constexpr bool operator!=(const T< R > &v0, const T< R > &v1)
Definition: vec.h:229
allocator_base< T, allocator_opts{.is_always_equal=false}> stateful_allocator
Base class for allocators that have state.
Definition: base.h:73
allocator_base< T, allocator_opts{.is_always_equal=true}> stateless_allocator
Base class for allocators that have no state.
Definition: base.h:66
constexpr bool operator==(const mat< CRTP, T, N > &m0, const mat< CRTP, T, N > &m1)
Definition: mat.h:57
bool is_always_equal
Definition: base.h:41