mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-02 04:56:58 +00:00
Allow the tri-comparator input to range functions to return std::strong_ordering, e.g. the result of operator<=>. An int input is still allowed, and coerced to std::strong_ordering by tri-comparing it against zero. Once all users are converted, this will be disallowed. The clever code that performs boundary comparisons unfortunately has to be dumbed down to conditionals. A helper require_ordering_and_on_equal_return() is introduced that accepts a comparison result between bound values, an expected comparison result, and what to return if the bound value matches (this depends on whether individual bounds are exclusive or inclusive, on whether the bounds are start bounds or end bounds, and on the sense of the comparison). Unfortunately, the code is somewhat pessimized, and there is no way to pessimize it as the enum underlying std::strong_ordering is hidden.
32 KiB
32 KiB