1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-06 09:01:01 +01:00

Remove comparator.hh and switch to <=> in a bunch of places

Known behavior changes:

- `MemorySourceAccessor`'s comparison operators no longer forget to
  compare the `SourceAccessor` base class.

Progress on #10832

What remains for that issue is hopefully much easier!
This commit is contained in:
John Ericson 2024-05-16 18:46:38 -04:00
parent 2a95a2d780
commit bc83b9dc1f
49 changed files with 300 additions and 271 deletions

View file

@ -73,6 +73,7 @@ struct ContentAddressMethod
Raw raw;
bool operator ==(const ContentAddressMethod &) const = default;
auto operator <=>(const ContentAddressMethod &) const = default;
MAKE_WRAPPER_CONSTRUCTOR(ContentAddressMethod);
@ -159,6 +160,7 @@ struct ContentAddress
*/
Hash hash;
bool operator ==(const ContentAddress &) const = default;
auto operator <=>(const ContentAddress &) const = default;
/**
@ -217,6 +219,10 @@ struct StoreReferences
* iff self is true.
*/
size_t size() const;
bool operator ==(const StoreReferences &) const = default;
// TODO libc++ 16 (used by darwin) missing `std::map::operator <=>`, can't do yet.
//auto operator <=>(const StoreReferences &) const = default;
};
// This matches the additional info that we need for makeTextPath
@ -232,6 +238,10 @@ struct TextInfo
* disallowed
*/
StorePathSet references;
bool operator ==(const TextInfo &) const = default;
// TODO libc++ 16 (used by darwin) missing `std::map::operator <=>`, can't do yet.
//auto operator <=>(const TextInfo &) const = default;
};
struct FixedOutputInfo
@ -250,6 +260,10 @@ struct FixedOutputInfo
* References to other store objects or this one.
*/
StoreReferences references;
bool operator ==(const FixedOutputInfo &) const = default;
// TODO libc++ 16 (used by darwin) missing `std::map::operator <=>`, can't do yet.
//auto operator <=>(const FixedOutputInfo &) const = default;
};
/**
@ -266,6 +280,10 @@ struct ContentAddressWithReferences
Raw raw;
bool operator ==(const ContentAddressWithReferences &) const = default;
// TODO libc++ 16 (used by darwin) missing `std::map::operator <=>`, can't do yet.
//auto operator <=>(const ContentAddressWithReferences &) const = default;
MAKE_WRAPPER_CONSTRUCTOR(ContentAddressWithReferences);
/**