From f4d917600e4e87dc9ed1fa2d6140cd834d75ef25 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Wed, 10 Jul 2024 15:54:27 +0200 Subject: ArtifactDigest: add order --- src/buildtool/common/artifact_digest.hpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/buildtool/common/artifact_digest.hpp b/src/buildtool/common/artifact_digest.hpp index ec3c65da..2ad94c27 100644 --- a/src/buildtool/common/artifact_digest.hpp +++ b/src/buildtool/common/artifact_digest.hpp @@ -90,6 +90,12 @@ class ArtifactDigest { } } + [[nodiscard]] auto operator<(ArtifactDigest const& other) const -> bool { + return (hash_ < other.hash_) or + ((hash_ == other.hash_) and (static_cast(is_tree_) < + static_cast(other.is_tree_))); + } + private: std::size_t size_{}; std::string hash_{}; -- cgit v1.2.3