diff options
author | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2025-01-08 23:40:52 +0100 |
---|---|---|
committer | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2025-01-08 23:40:52 +0100 |
commit | 838c4b9a45a50f252c7b20d14570b0b7463709ab (patch) | |
tree | f50b70c18236a0d3f0b93994d5b0fb8955dd58d6 /asl/status.hpp | |
parent | b94a42b978251c4cdb4eb0be2a2e8d9dc8949eba (diff) |
Finish work on hashing probably
Diffstat (limited to 'asl/status.hpp')
-rw-r--r-- | asl/status.hpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/asl/status.hpp b/asl/status.hpp index aa64e4e..9645f96 100644 --- a/asl/status.hpp +++ b/asl/status.hpp @@ -104,9 +104,6 @@ public: return m_payload == nullptr; } - // NOLINTNEXTLINE(*-explicit-conversions) - constexpr operator bool() const { return ok(); } - constexpr status_code code() const { return is_inline() ? code_inline() : code_internal(); @@ -122,6 +119,16 @@ public: } friend void AslFormat(Formatter& f, const status&); + + template<typename H> + friend H AslHashValue(H h, const status& s) + { + if (s.is_inline()) + { + return H::combine(ASL_MOVE(h), s.code()); + } + return H::combine(ASL_MOVE(h), s.code(), s.message()); + } }; static constexpr status ok() { return status{status_code::ok}; } |