From 179c8bead451a6a7e9df169758b7a77aa1f469c2 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Thu, 4 Oct 2018 17:57:17 +1000 Subject: [PATCH] alloc/arena: add inner allocator accessor --- alloc/arena.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/alloc/arena.hpp b/alloc/arena.hpp index 0a96b2f7..02f41f64 100644 --- a/alloc/arena.hpp +++ b/alloc/arena.hpp @@ -128,6 +128,12 @@ namespace cruft::alloc { decltype(auto) reset (Args&&...args) { return m_store.reset (std::forward (args)...); } + /// Returns a const reference to the inner allocator. + /// + /// Do not return a non-const reference. If the user wants direct + /// access they should directly use a non-owning arena. + auto const& store (void) const& { return m_store; } + private: AllocT m_store; arena m_arena;