From b3f2336e1b8f4410515344feb73d992d854c8282 Mon Sep 17 00:00:00 2001 From: Steven Le Rouzic Date: Sun, 26 Jan 2025 22:35:47 +0100 Subject: Implement logging --- asl/box.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'asl/box.hpp') diff --git a/asl/box.hpp b/asl/box.hpp index f193853..795b6dd 100644 --- a/asl/box.hpp +++ b/asl/box.hpp @@ -90,6 +90,9 @@ public: { return H::combine(ASL_MOVE(h), *b); } + + template + friend constexpr U* leak(box&&); }; template @@ -111,5 +114,11 @@ constexpr box make_box(Args&&... args) return box(ptr, ASL_MOVE(allocator)); } +template +constexpr T* leak(box&& b) +{ + return exchange(b.m_ptr, nullptr); +} + } // namespace asl -- cgit