summaryrefslogtreecommitdiffhomepage
path: root/dev/LibCompiler/NFC/ErrorOr.h
diff options
context:
space:
mode:
Diffstat (limited to 'dev/LibCompiler/NFC/ErrorOr.h')
-rw-r--r--dev/LibCompiler/NFC/ErrorOr.h61
1 files changed, 0 insertions, 61 deletions
diff --git a/dev/LibCompiler/NFC/ErrorOr.h b/dev/LibCompiler/NFC/ErrorOr.h
deleted file mode 100644
index 9dc607e..0000000
--- a/dev/LibCompiler/NFC/ErrorOr.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * ========================================================
- *
- * LibCompiler
- * Copyright (C) 2024-2025 Amlal El Mahrouss, all rights reserved.
- *
- * ========================================================
- */
-
-#pragma once
-
-#include <LibCompiler/Defines.h>
-#include <LibCompiler/NFC/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