[libcxx-commits] [PATCH] D145881: [libc++][spaceship] Implement `operator<=>` for `duration`

Hristo Hristov via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Mar 18 05:31:23 PDT 2023


H-G-Hristov marked 2 inline comments as done.
H-G-Hristov added a comment.

In D145881#4202992 <https://reviews.llvm.org/D145881#4202992>, @Mordante wrote:

> In D145881#4200625 <https://reviews.llvm.org/D145881#4200625>, @H-G-Hristov wrote:
>
>> In D145881#4199876 <https://reviews.llvm.org/D145881#4199876>, @Mordante wrote:
>>
>>> Thanks for working on this! A few comments.
>>
>> Thank you for the review. I'll make sure to contact you first in the future as you recommend.
>> Sorry if working on this and on `time_point` D146250 <https://reviews.llvm.org/D146250> was inappropirate.
>
> The main thing we want to avoid is having multiple people working on the same feature.
> Somethings something in the list is assigned and appears not to be moving, but there might be reasons.
> For example parts of the regex spaceship I've been working on, but it was blocked.
>
> I've not started on duration and timepoint, so feel free to implement them.
>
> If you want to look at other things for the spaceship operator. I *think* not all items of paper P1614 <https://reviews.llvm.org/P1614> are on the list, specifically the removal of `operator!=`, which will be automatically generated.
> If you want to update the status page with these missing entries it would be very much appreciated.

Thank you for this suggestion and the review! Sure, I'll look into P1614R2 <https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html> and see what I can do when I have time and I'll report back on Discord if necessary.



================
Comment at: libcxx/test/std/time/time.duration/time.duration.comparisons/compare.three_way.pass.cpp:65
+    constexpr std::chrono::duration<int, std::ratio<2, 3>> s1(9);
+    constexpr std::chrono::duration<double, std::ratio<3, 5>> s2(10);
+    static_assert((s1 <=> s2) == std::strong_ordering::equal);
----------------
Mordante wrote:
> Nit I think it's safer to use less or greater when comparing floating point values.
I hope I resolved it as you requested.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145881/new/

https://reviews.llvm.org/D145881



More information about the libcxx-commits mailing list