mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:28:12 +00:00
Kernel: Make KResult usable with TRY() as well
This patch adds release_error() and release_value() to KResult, making it usable with TRY(). Note that release_value() returns void, since there is no value inside a KResult.
This commit is contained in:
parent
71187d865e
commit
e1af24eac8
1 changed files with 4 additions and 0 deletions
|
@ -40,6 +40,10 @@ public:
|
|||
bool operator!=(KSuccessTag) const { return is_error(); }
|
||||
bool operator==(KSuccessTag) const { return !is_error(); }
|
||||
|
||||
// NOTE: These are here to make KResult usable with TRY()
|
||||
KResult release_error() { return *this; }
|
||||
void release_value() { }
|
||||
|
||||
private:
|
||||
template<typename T>
|
||||
friend class KResultOr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue