diff --git a/alloc/arena.hpp b/alloc/arena.hpp index fd3a3a2e..0a96b2f7 100644 --- a/alloc/arena.hpp +++ b/alloc/arena.hpp @@ -94,11 +94,24 @@ namespace cruft::alloc { class owned { public: template - owned (ArgsT &&...args): - m_store (std::forward (args)...), - m_arena {m_store} + explicit owned (ArgsT &&...args) + : m_store (std::forward (args)...) + , m_arena {m_store} { ; } + owned (owned &&rhs) + : m_store (std::move (rhs.m_store)) + , m_arena (m_store) + { ; } + + owned& operator= (owned &&rhs) + { + m_store = std::move (rhs.m_store); + } + + owned (owned const&) = delete; + owned& operator= (owned const&) = delete; + template decltype(auto) acquire (ArgsT &&...args) { return m_arena.template acquire (std::forward (args)...); } @@ -119,6 +132,6 @@ namespace cruft::alloc { AllocT m_store; arena m_arena; }; -}; +} #endif