From 3844e340536b2d671e413e6b0e03b6e03ade5c60 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Mon, 3 Mar 2025 20:48:59 +0100 Subject: [PATCH] libutil: add box_ptr::take sometimes it's useful to turn a box into a unique_ptr. let's have that. Change-Id: I3d142c6e157c5e61c16f3953b3b8b4cd616f0e93 --- lix/libutil/box_ptr.hh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lix/libutil/box_ptr.hh b/lix/libutil/box_ptr.hh index f7e4fd509..e2722c0bb 100644 --- a/lix/libutil/box_ptr.hh +++ b/lix/libutil/box_ptr.hh @@ -72,6 +72,11 @@ public: } box_ptr(box_ptr & other) = delete; + + std::unique_ptr take() && + { + return std::move(inner); + } }; template