From 2ddaf86857828500235e8b8a65c11bb2dd91b8be Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Mon, 8 Dec 2025 01:57:30 -0500 Subject: chore! breaking API changes and new APIs introduced. Signed-off-by: Amlal El Mahrouss --- include/CompilerKit/ErrorOr.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'include/CompilerKit/ErrorOr.h') diff --git a/include/CompilerKit/ErrorOr.h b/include/CompilerKit/ErrorOr.h index 100624e..db8339a 100644 --- a/include/CompilerKit/ErrorOr.h +++ b/include/CompilerKit/ErrorOr.h @@ -29,6 +29,8 @@ class ErrorOr final { ~ErrorOr() = default; public: + using RefType = Ref; + explicit ErrorOr(ErrorT err) : mId(err) {} explicit ErrorOr(std::nullptr_t null) {} explicit ErrorOr(T klass) : mRef(klass) {} @@ -36,7 +38,7 @@ class ErrorOr final { ErrorOr& operator=(const ErrorOr&) = default; ErrorOr(const ErrorOr&) = default; - Ref& Leak() { return mRef; } + RefType& Leak() { return mRef; } ErrorT Error() { return mId; } @@ -45,8 +47,8 @@ class ErrorOr final { explicit operator bool() { return mRef; } private: - Ref mRef; - ErrorT mId{0}; + RefType mRef; + ErrorT mId{0}; }; using ErrorOrAny = ErrorOr; -- cgit v1.2.3