/* * ======================================================== * * CompilerKit * Copyright Mahrouss Logic, all rights reserved. * * ======================================================== */ #pragma once #include #include namespace CompilerKit { using ErrorT = UInt32; template 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 Leak() { return mRef; } operator bool() { return mRef; } private: Ref mRef; Int32 mId{0}; }; using ErrorOrAny = ErrorOr; } // namespace CompilerKit