Implements parts of P1614R2
Implemented operator<=> for std::chrono::duration
Details
- Reviewers
Mordante - Group Reviewers
Restricted Project - Commits
- rG83542e47644e: [libc++][spaceship] Implement `operator<=>` for `duration`
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
@Mordante I decided to work on <=> for duration and time_point. I see these are assigned to you. Sorry if I am interfering with your plans, feel free to reject this patch if necessary.
Thanks for working on this! A few comments.
libcxx/docs/Status/SpaceshipProjects.csv | ||
---|---|---|
55 | Please reach out to us on Discord when you want to work on patches that are assigned to people, me in this case. | |
libcxx/test/std/time/time.duration/time.duration.comparisons/compare.three_way.pass.cpp | ||
27 | Please add runtime tests too. test(); static_assert(test()); pattern in other patches. If not I can point you to examples. | |
66 | Nit I think it's safer to use less or greater when comparing floating point values. |
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 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 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.
libcxx/test/std/time/time.duration/time.duration.comparisons/compare.three_way.pass.cpp | ||
---|---|---|
29 | I would remove the constexpr here, I don't think it's needed. |
Thank you for the review!
I should have commit access now but it will be my first attempt.
I've setup SSH keys with my GitHub account.
Would that be the right procedure:
$ cd llvm-project
$ git checkout P1614R2-spaceship-operator-duration
$ arc land
This page describes a git based approach https://llvm.org/docs/Contributing.html
The CI failures appear unrelated. Shall I try to commit now?
If you created the review you can indeed use arc land. Feel free to commit the change!
If you run into issues best visit Discord, there we're faster to respond.
Nice I see committing work!
FYI arc land will automatically rebase for you. There is no need to update the review with these changes.
Thank you very much!
I got two error messages one after another. So I thought that I needed to rebase to fix them:
To GitHub-Zingam:llvm/llvm-project.git
! [rejected] cac4b7737e82 -> main (fetch first)
error: failed to push some refs to 'GitHub-Zingam:llvm/llvm-project.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.LOAD STATE Restoring local state (to ref "hgh/libcxx/P1614R2-spaceship-operator-duration" at commit "1d649b88b388").
USAGE EXCEPTION Push failed! Fix the error and run "arc land" again.
And then:
INTO COMMIT Preparing merge into "main" from remote "origin", at commit "fa6ea7a419f3".
<!> UNKNOWN REVISION
Unable to determine which revision is associated with commit "934d897e41a9".
Use "arc diff" to create or update a revision with this commit, or
"--revision" to force selection of a particular revision.USAGE EXCEPTION Unable to determine revision for commit "934d897e41a9".
Only after the second rebase and arc diff --update-ing twice the arc land completed successfuly.
Maybe I did something wrong. I hope that it's not a problem.
<snip>
Only after the second rebase and arc diff --update-ing twice the arc land completed successfuly.
Maybe I did something wrong. I hope that it's not a problem.
This happens sometimes, the arc land operation is not atomic. For example
- you fetch the commits
- somebody else lands their patch
- you rebase
- now your push fails
I normally just do arc land a second time, and occasionally a third time.
Please reach out to us on Discord when you want to work on patches that are assigned to people, me in this case.
Some of the patches in this list already have patches locally that are block for various reasons.