1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:28:12 +00:00

Kernel: Add KResultOr::release_error()

This is just for symmetry with AK::Result, so that we can use them
interchangeably in generic code.
This commit is contained in:
Andreas Kling 2021-09-05 13:29:06 +02:00
parent 09dd397160
commit fd44336ef8

View file

@ -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)];