diff options
author | Andreas Kling <kling@serenityos.org> | 2021-09-05 13:29:06 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-05 13:29:06 +0200 |
commit | fd44336ef8d0f1dac936d57a8d06f31bb6a3a0ba (patch) | |
tree | eb990f626d24a8b776e7bda56516d70183eea945 /Kernel | |
parent | 09dd397160a0081568f964c04db0c55db6cb52d5 (diff) | |
download | serenity-fd44336ef8d0f1dac936d57a8d06f31bb6a3a0ba.zip |
Kernel: Add KResultOr::release_error()
This is just for symmetry with AK::Result, so that we can use them
interchangeably in generic code.
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/API/KResult.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Kernel/API/KResult.h b/Kernel/API/KResult.h index 95dc9d0089..67521f7575 100644 --- a/Kernel/API/KResult.h +++ b/Kernel/API/KResult.h @@ -162,6 +162,12 @@ public: return released_value; } + [[nodiscard]] KResult release_error() + { + VERIFY(m_is_error); + return m_error; + } + private: union { alignas(T) char m_storage[sizeof(T)]; |