diff options
| author | Amlal <amlal@nekernel.org> | 2025-04-25 13:14:01 +0200 |
|---|---|---|
| committer | Amlal <amlal@nekernel.org> | 2025-04-25 13:14:01 +0200 |
| commit | 20042235d1f53ae428aa154e64afdbae5d8d91ad (patch) | |
| tree | 6ea42d1b30505a57301f8ff2916c78ce94ff6eaf /dev/LibCompiler/ErrorOr.h | |
| parent | 0561a8d0a6ae7588309a6e3513bbfeeef5f0aa15 (diff) | |
meta: update .clang-format, format codebase.
Signed-off-by: Amlal <amlal@nekernel.org>
Diffstat (limited to 'dev/LibCompiler/ErrorOr.h')
| -rw-r--r-- | dev/LibCompiler/ErrorOr.h | 78 |
1 files changed, 31 insertions, 47 deletions
diff --git a/dev/LibCompiler/ErrorOr.h b/dev/LibCompiler/ErrorOr.h index 2a6d590..ca93dd2 100644 --- a/dev/LibCompiler/ErrorOr.h +++ b/dev/LibCompiler/ErrorOr.h @@ -12,50 +12,34 @@ #include <LibCompiler/Defines.h> #include <LibCompiler/Ref.h> -namespace LibCompiler -{ - using ErrorT = UInt32; - - template <typename T> - class ErrorOr final - { - public: - ErrorOr() = default; - ~ErrorOr() = default; - - public: - explicit ErrorOr(Int32 err) - : mId(err) - { - } - - explicit ErrorOr(nullPtr Null) - { - } - - explicit ErrorOr(T Class) - : mRef(Class) - { - } - - ErrorOr& operator=(const ErrorOr&) = default; - ErrorOr(const ErrorOr&) = default; - - Ref<T> Leak() - { - return mRef; - } - - operator bool() - { - return mRef; - } - - private: - Ref<T> mRef; - Int32 mId{0}; - }; - - using ErrorOrAny = ErrorOr<voidPtr>; - -} // namespace LibCompiler +namespace LibCompiler { +using ErrorT = UInt32; + +template <typename T> +class ErrorOr final { + public: + ErrorOr() = default; + ~ErrorOr() = default; + + public: + explicit ErrorOr(Int32 err) : mId(err) {} + + explicit ErrorOr(nullPtr Null) {} + + explicit ErrorOr(T Class) : mRef(Class) {} + + ErrorOr& operator=(const ErrorOr&) = default; + ErrorOr(const ErrorOr&) = default; + + Ref<T> Leak() { return mRef; } + + operator bool() { return mRef; } + + private: + Ref<T> mRef; + Int32 mId{0}; +}; + +using ErrorOrAny = ErrorOr<voidPtr>; + +} // namespace LibCompiler |
