1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-14 21:11:04 +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

@ -6,9 +6,7 @@
#include <set>
#include <variant>
#include "comparator.hh"
#include "json-impls.hh"
#include "comparator.hh"
#include "variant-wrapper.hh"
namespace nix {
@ -60,7 +58,11 @@ struct OutputsSpec {
Raw raw;
GENERATE_CMP(OutputsSpec, me->raw);
bool operator == (const OutputsSpec &) const = default;
// TODO libc++ 16 (used by darwin) missing `std::set::operator <=>`, can't do yet.
bool operator < (const OutputsSpec & other) const {
return raw < other.raw;
}
MAKE_WRAPPER_CONSTRUCTOR(OutputsSpec);
@ -99,7 +101,9 @@ struct ExtendedOutputsSpec {
Raw raw;
GENERATE_CMP(ExtendedOutputsSpec, me->raw);
bool operator == (const ExtendedOutputsSpec &) const = default;
// TODO libc++ 16 (used by darwin) missing `std::set::operator <=>`, can't do yet.
bool operator < (const ExtendedOutputsSpec &) const;
MAKE_WRAPPER_CONSTRUCTOR(ExtendedOutputsSpec);