diff --git a/Kernel/KResult.h b/Kernel/KResult.h index 5b70fd7681..ed670ac0a9 100644 --- a/Kernel/KResult.h +++ b/Kernel/KResult.h @@ -138,18 +138,20 @@ public: [[nodiscard]] KResult result() const { return m_is_error ? m_error : KSuccess; } - [[nodiscard]] ALWAYS_INLINE T& value() + [[nodiscard]] ALWAYS_INLINE T& value() & { VERIFY(!m_is_error); return *reinterpret_cast(&m_storage); } - [[nodiscard]] ALWAYS_INLINE const T& value() const + [[nodiscard]] ALWAYS_INLINE T const& value() const& { VERIFY(!m_is_error); return *reinterpret_cast(&m_storage); } + T value() && = delete; + [[nodiscard]] ALWAYS_INLINE T release_value() { VERIFY(!m_is_error);