From 6064800f39194da96723849dcf049058b271018c Mon Sep 17 00:00:00 2001 From: chriselrod Date: Wed, 19 Jul 2023 18:57:41 -0400 Subject: [PATCH] Return pointer from `get_allocator` to work better with methods that expect a pointer. --- include/Utilities/Allocators.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/Utilities/Allocators.hpp b/include/Utilities/Allocators.hpp index b635f24..75116e5 100644 --- a/include/Utilities/Allocators.hpp +++ b/include/Utilities/Allocators.hpp @@ -421,7 +421,8 @@ class WArena { constexpr explicit WArena(const WArena &other) = default; template constexpr explicit WArena(WArena other) : A(other.get_allocator()) {} - [[nodiscard]] constexpr auto get_allocator() const -> NotNull { + [[nodiscard, gnu::returns_nonnull]] constexpr auto get_allocator() const + -> Alloc * { return A; } constexpr void deallocate(T *p, ptrdiff_t n) { A->deallocate(p, n); }