-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove comparator.hh
and use new C++ comparison operator defaulting
#10832
Comments
Ericson2314
added a commit
to obsidiansystems/nix
that referenced
this issue
Jun 3, 2024
Progress on NixOS#10832 This doesn't switch to auto-deriving the fields, but by defining `<=>` we allow deriving `<=>` in downstream types where `Hash` is used.
Ericson2314
added a commit
to obsidiansystems/nix
that referenced
this issue
Jun 3, 2024
Known behavior changes: - `MemorySourceAccessor`'s comparison operators no longer forget to compare the `SourceAccessor` base class. Progress on NixOS#10832 What remains for that issue is hopefully much easier!
After #10838, just have a couple of |
Ericson2314
added a commit
to obsidiansystems/nix
that referenced
this issue
Jun 3, 2024
Known behavior changes: - `MemorySourceAccessor`'s comparison operators no longer forget to compare the `SourceAccessor` base class. Progress on NixOS#10832 What remains for that issue is hopefully much easier!
Ericson2314
added a commit
to obsidiansystems/nix
that referenced
this issue
Jun 5, 2024
Known behavior changes: - `MemorySourceAccessor`'s comparison operators no longer forget to compare the `SourceAccessor` base class. Progress on NixOS#10832 What remains for that issue is hopefully much easier!
Ericson2314
added a commit
to obsidiansystems/nix
that referenced
this issue
Jun 13, 2024
Known behavior changes: - `MemorySourceAccessor`'s comparison operators no longer forget to compare the `SourceAccessor` base class. Progress on NixOS#10832 What remains for that issue is hopefully much easier!
Ericson2314
added a commit
to obsidiansystems/nix
that referenced
this issue
Jul 12, 2024
Known behavior changes: - `MemorySourceAccessor`'s comparison operators no longer forget to compare the `SourceAccessor` base class. Progress on NixOS#10832 What remains for that issue is hopefully much easier!
Ericson2314
added a commit
to obsidiansystems/nix
that referenced
this issue
Jul 12, 2024
Known behavior changes: - `MemorySourceAccessor`'s comparison operators no longer forget to compare the `SourceAccessor` base class. Progress on NixOS#10832 What remains for that issue is hopefully much easier!
Ericson2314
added a commit
to obsidiansystems/nix
that referenced
this issue
Jul 12, 2024
Known behavior changes: - `MemorySourceAccessor`'s comparison operators no longer forget to compare the `SourceAccessor` base class. Progress on NixOS#10832 What remains for that issue is hopefully much easier!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See the docs on Default comparisons (since C++20) https://en.cppreference.com/w/cpp/language/default_comparisons
In short, one can now do
And this will work in the vast majority of cases.
This is better than the
src/libutil/comparator.hh
tricks we did before (predating C++ 20) of deriving those methods based on constructing astd::tuple
with all the fields we wanted to compare on the fly.The text was updated successfully, but these errors were encountered: