From b21cb64fdf2c3112a69887d7032297392999e8e6 Mon Sep 17 00:00:00 2001 From: alk <45172705+altalk23@users.noreply.github.com> Date: Sat, 3 Dec 2022 17:41:51 +0300 Subject: [PATCH] Update Result.hpp --- loader/include/Geode/utils/Result.hpp | 34 ++++++++++++--------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/loader/include/Geode/utils/Result.hpp b/loader/include/Geode/utils/Result.hpp index 56c31ae1..5ca31b4e 100644 --- a/loader/include/Geode/utils/Result.hpp +++ b/loader/include/Geode/utils/Result.hpp @@ -9,8 +9,6 @@ #include #include -// clang-format on - namespace geode { namespace impl { using DefaultValue = std::monostate; @@ -115,47 +113,47 @@ namespace geode { constexpr Result(impl::Success&& s) : Base(std::move(s.value())) {} [[nodiscard]] constexpr explicit operator bool() const noexcept { - return this->operator bool(); + return this->Base::operator bool(); } [[nodiscard]] constexpr bool isOk() const noexcept { - return this->has_value(); + return this->Base::has_value(); } [[nodiscard]] constexpr bool isErr() const noexcept { - return this->has_error(); + return this->Base::has_error(); } [[nodiscard]] constexpr decltype(auto) unwrap() & { - return this->value(); + return this->Base::value(); } [[nodiscard]] constexpr decltype(auto) unwrap() const& { - return this->value(); + return this->Base::value(); } [[nodiscard]] constexpr decltype(auto) unwrap() && { - return this->value(); + return this->Base::value(); } [[nodiscard]] constexpr decltype(auto) unwrap() const&& { - return this->value(); + return this->Base::value(); } [[nodiscard]] constexpr decltype(auto) unwrapErr() & { - return this->error(); + return this->Base::error(); } [[nodiscard]] constexpr decltype(auto) unwrapErr() const& { - return this->error(); + return this->Base::error(); } [[nodiscard]] constexpr decltype(auto) unwrapErr() && { - return this->error(); + return this->Base::error(); } [[nodiscard]] constexpr decltype(auto) unwrapErr() const&& { - return this->error(); + return this->Base::error(); } template @@ -174,22 +172,22 @@ namespace geode { template [[nodiscard]] constexpr decltype(auto) unwrapOr(U&& val) && { - return this->value_or(std::forward(val)); + return this->Base::value_or(std::forward(val)); } template [[nodiscard]] constexpr decltype(auto) unwrapOr(U&& val) const& { - return this->value_or(std::forward(val)); + return this->Base::value_or(std::forward(val)); } template [[nodiscard]] constexpr decltype(auto) errorOr(U&& val) && { - return this->error_or(std::forward(val)); + return this->Base::error_or(std::forward(val)); } template [[nodiscard]] constexpr decltype(auto) errorOr(U&& val) const& { - return this->error_or(std::forward(val)); + return this->Base::error_or(std::forward(val)); } }; @@ -230,5 +228,3 @@ namespace geode { } \ } } - -// clang-format on