aboutsummaryrefslogtreecommitdiff
path: root/src/libstore
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2023-04-01 16:52:23 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2023-04-01 16:52:23 -0400
commit5d56e2daf70788fae532d1875edbd4e9bdb5afef (patch)
treee9d22b90b4bd5e8c844e8b8556dc0437a8240f42 /src/libstore
parentc51d554c933b5fe294da41fcdf5afe0d4f33f586 (diff)
Add comparison methods for content addresses
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/content-address.hh12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/libstore/content-address.hh b/src/libstore/content-address.hh
index d1dd1256c..737bf9a41 100644
--- a/src/libstore/content-address.hh
+++ b/src/libstore/content-address.hh
@@ -46,8 +46,10 @@ enum struct FileIngestionMethod : uint8_t {
std::string makeFileIngestionPrefix(FileIngestionMethod m);
struct FixedOutputHashMethod {
- FileIngestionMethod fileIngestionMethod;
- HashType hashType;
+ FileIngestionMethod fileIngestionMethod;
+ HashType hashType;
+
+ GENERATE_CMP(FixedOutputHashMethod, me->fileIngestionMethod, me->hashType);
};
/**
@@ -67,6 +69,8 @@ struct ContentAddressMethod
Raw raw;
+ GENERATE_CMP(ContentAddressMethod, me->raw);
+
/* The moral equivalent of `using Raw::Raw;` */
ContentAddressMethod(auto &&... arg)
: raw(std::forward<decltype(arg)>(arg)...)
@@ -134,6 +138,8 @@ struct ContentAddress
Raw raw;
+ GENERATE_CMP(ContentAddress, me->raw);
+
/* The moral equivalent of `using Raw::Raw;` */
ContentAddress(auto &&... arg)
: raw(std::forward<decltype(arg)>(arg)...)
@@ -229,6 +235,8 @@ struct ContentAddressWithReferences
Raw raw;
+ GENERATE_CMP(ContentAddressWithReferences, me->raw);
+
/* The moral equivalent of `using Raw::Raw;` */
ContentAddressWithReferences(auto &&... arg)
: raw(std::forward<decltype(arg)>(arg)...)