1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-26 03:21:16 +02: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

@ -47,19 +47,14 @@ SourcePath SourcePath::operator / (const CanonPath & x) const
SourcePath SourcePath::operator / (std::string_view c) const
{ return {accessor, path / c}; }
bool SourcePath::operator==(const SourcePath & x) const
bool SourcePath::operator==(const SourcePath & x) const noexcept
{
return std::tie(*accessor, path) == std::tie(*x.accessor, x.path);
}
bool SourcePath::operator!=(const SourcePath & x) const
std::strong_ordering SourcePath::operator<=>(const SourcePath & x) const noexcept
{
return std::tie(*accessor, path) != std::tie(*x.accessor, x.path);
}
bool SourcePath::operator<(const SourcePath & x) const
{
return std::tie(*accessor, path) < std::tie(*x.accessor, x.path);
return std::tie(*accessor, path) <=> std::tie(*x.accessor, x.path);
}
std::ostream & operator<<(std::ostream & str, const SourcePath & path)