From ad627b7c7024eb0e332d96f9d2280155013f3415 Mon Sep 17 00:00:00 2001
From: Patrick Wuttke
Date: Mon, 14 Jul 2025 17:16:09 +0200
Subject: [PATCH] Added NotNullable::release() function.
---
source/mijin/util/annot.hpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/source/mijin/util/annot.hpp b/source/mijin/util/annot.hpp
index adc406b..d1dd3e9 100644
--- a/source/mijin/util/annot.hpp
+++ b/source/mijin/util/annot.hpp
@@ -160,6 +160,9 @@ public:
[[nodiscard]]
constexpr const T& get() const MIJIN_NOEXCEPT { return base_; }
+ [[nodiscard]]
+ constexpr T release() && MIJIN_NOEXCEPT { return std::exchange(base_, nullptr); }
+
template
friend class NotNullable;
};