diff --git a/include/scorpio_utils/expected.hpp b/include/scorpio_utils/expected.hpp index 0ce45a8..cc3bacb 100644 --- a/include/scorpio_utils/expected.hpp +++ b/include/scorpio_utils/expected.hpp @@ -93,14 +93,14 @@ class Expected : public std::variant { } constexpr std::optional err() && { - if (SCU_UNLIKELY(is_ok())) { + if (SCU_LIKELY(is_ok())) { return std::nullopt; } return std::get(std::move(*this)); } constexpr std::optional> err() const& { - if (SCU_UNLIKELY(is_ok())) { + if (SCU_LIKELY(is_ok())) { return std::nullopt; } return std::cref(std::get(*this));