9static thread_local inline std::unique_ptr<uint8_t[]> global_stack_allocator_buffer(
13static thread_local inline stack_allocator global_stack_allocator{ global_stack_allocator_buffer.get(),
22 using size_type = std::size_t;
23 using difference_type = std::ptrdiff_t;
24 using propagate_on_container_move_assignment = std::true_type;
27 temp_allocator() =
default;
33 constexpr temp_allocator(
const temp_allocator<U>& other)
noexcept {
39 [[nodiscard]]
constexpr T* allocate(std::size_t n) {
40 auto* ptr =
static_cast<T*
>(global_stack_allocator.allocate(n *
sizeof(T),
alignof(T)));
42 throw std::bad_alloc{};
51 constexpr void deallocate(T* p, [[maybe_unused]] std::size_t n) {
52 return global_stack_allocator.deallocate(p);
59template<
class T,
class U>
60constexpr bool operator==(
const co_ecs::detail::temp_allocator<T>&,
const co_ecs::detail::temp_allocator<U>&)
noexcept {
64template<
class T,
class U>
65constexpr bool operator!=(
const co_ecs::detail::temp_allocator<T>&,
const co_ecs::detail::temp_allocator<U>&)
noexcept {
Definition component.hpp:17
constexpr auto global_stack_allocator_size
Definition temp_allocator.hpp:7
constexpr bool operator==(const co_ecs::detail::temp_allocator< T > &, const co_ecs::detail::temp_allocator< U > &) noexcept
Definition temp_allocator.hpp:60
constexpr bool operator!=(const co_ecs::detail::temp_allocator< T > &, const co_ecs::detail::temp_allocator< U > &) noexcept
Definition temp_allocator.hpp:65