Skip to content

Commit

Permalink
Return pointer from get_allocator
Browse files Browse the repository at this point in the history
to work better with methods that expect a pointer.
  • Loading branch information
chriselrod committed Jul 19, 2023
1 parent 54885a0 commit 6064800
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/Utilities/Allocators.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,8 @@ class WArena {
constexpr explicit WArena(const WArena &other) = default;
template <typename U>
constexpr explicit WArena(WArena<U> other) : A(other.get_allocator()) {}
[[nodiscard]] constexpr auto get_allocator() const -> NotNull<Alloc> {
[[nodiscard, gnu::returns_nonnull]] constexpr auto get_allocator() const
-> Alloc * {
return A;
}
constexpr void deallocate(T *p, ptrdiff_t n) { A->deallocate(p, n); }
Expand Down

0 comments on commit 6064800

Please sign in to comment.