From cbade33906dc0d090d5dba6231fb48e359afff95 Mon Sep 17 00:00:00 2001 From: Steven Le Rouzic Date: Wed, 12 Mar 2025 00:37:23 +0100 Subject: Some more shit --- asl/types/status.hpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'asl/types/status.hpp') diff --git a/asl/types/status.hpp b/asl/types/status.hpp index 83be5ce..df96cd8 100644 --- a/asl/types/status.hpp +++ b/asl/types/status.hpp @@ -38,12 +38,12 @@ class status return static_cast(bit_cast(payload) >> 1); } - constexpr bool is_inline() const + [[nodiscard]] constexpr bool is_inline() const { return m_payload == nullptr || (bit_cast(m_payload) & 1) != 0; } - constexpr status_code code_inline() const + [[nodiscard]] constexpr status_code code_inline() const { ASL_ASSERT(is_inline()); if (m_payload == nullptr) @@ -53,8 +53,8 @@ class status return payload_to_status(m_payload); } - status_code code_internal() const; - string_view message_internal() const; + [[nodiscard]] status_code code_internal() const; + [[nodiscard]] string_view message_internal() const; void ref(); void unref(); @@ -103,17 +103,17 @@ public: return *this; } - constexpr bool ok() const + [[nodiscard]] constexpr bool ok() const { return m_payload == nullptr; } - constexpr status_code code() const + [[nodiscard]] constexpr status_code code() const { return is_inline() ? code_inline() : code_internal(); } - constexpr string_view message() const + [[nodiscard]] constexpr string_view message() const { if (!is_inline()) { @@ -156,6 +156,6 @@ ASL_DEFINE_ERROR_(internal) ASL_DEFINE_ERROR_(runtime) ASL_DEFINE_ERROR_(invalid_argument) -#define ASL_TRY(VALUE) if (VALUE.ok()) {} else { return std::move(VALUE).throw_status(); } +#define ASL_TRY(VALUE) if ((VALUE).ok()) {} else { return std::move(VALUE).throw_status(); } } // namespace asl -- cgit