[Bug c++/96489] Three way comparison operator failure to synthesize traditional comparitors
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Aug 6 19:05:29 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96489
--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to DV Henkel-Wallace from comment #7)
> Thanks. That is clear.
>
> BTW FWIW, defining <=> myself and then defining == default does appear to do
> what I want (i.e. I don't have to use. = default with both operators).
Right, that's what I said (or tried to say) in comment 3:
"I think to get what you expect, you need to either define <=> as defaulted,
or define == as defaulted."
Either works fine, it doesn't need to be both.
> saw that cppreference claims that `== default` will do `<=> < 0` -- though I
> know that site isn't authoritative, merely close to authorotative.
https://en.cppreference.com/w/cpp/language/default_comparisons seems correct,
although it notes:
This section is incomplete
Reason: Defaulted equality comparisons
More information about the Gcc-bugs
mailing list