Implements parts of:
- P0898R3 Standard Library Concepts
- P1754 Rename concepts to standard_case for C++20, while we still can
Paths
| Differential D98983
[libcxx] adds concepts `std::totally_ordered` and `std::totally_ordered_with` ClosedPublic Authored by cjdb on Mar 19 2021, 1:24 PM.
Details
Summary Implements parts of:
Diff Detail
Event TimelineComment Actions @zoecarver I'm keeping types.h where it is since I think this one is hyper-specific to the tests, as opposed to the others, which are more general. Comment Actions All of these .compile.pass.cpp tests should be .pass.cpp. It's harmless to run them, and we don't want to accidentally nerf any runtime asserts that might sneak in over the years.
cjdb marked 4 inline comments as done. Comment Actionsapplies most of @Quuxplusone's feedback (the rest to be addressed in comments). Comment Actions
@EricWF and I were talking about this yesterday, interestingly. We agree, but we also agreed this should happen after everything is merged so it all remains consistent. WDYT?
curdeius added inline comments.
Comment Actions For now a few comments, I'll have a closer look later.
Comment Actions No real blockers for me, but I'd like to see the patch pass the CI before approving.
Comment Actions Just a few comments right now. I'll try to do a more in-depth review later.
cjdb added inline comments.
cjdb marked 3 inline comments as done. Comment Actionss/__const_lvalue_reference/__make_const_lvalue_reference/g Comment Actions Are there any further blockers on this patch? I think I've replied to all the feedback.
Comment Actions LGTM! I'll already approve so @zoecarver can give the final approval.
• Quuxplusone added inline comments.
Comment Actions This mostly looks good to me. I want to read over the logic part one more time while looking at the standard, but I think this is pretty much good to go. Sorry for being slow with reviewing.
Comment Actions Okay, this (finally) looks good to me. As we discussed, I think cutting down these tests a bit in the future will help me review it more quickly (and it would make me feel more confident that I haven't overlooked something). Maybe we should have a larger discussion about how we want to do concept tests in the discord channel. I think it would be beneficial to everyone to solidify some guidelines. This revision is now accepted and ready to land.Apr 1 2021, 10:13 PM Comment Actions (Also, please run this through clang-format or fix the formatting issues I pointed out earlier before you commit.) Comment Actions
This is the product of clang-format. Per @ldionne's musings in D99691, manually overriding clang-format is going to become a hard error in the future.
Yes, future patches will have a reduced set of tests for the most part, because they're not (a) testing the boundary of the language and library, and (b) testing a completely novel compiler feature with minimal field experience. D96477 is an example of this plan.
cjdb marked 2 inline comments as done. Comment Actionsupdates per @zoecarver's feedback (just for the record) This revision was landed with ongoing or failed builds.Apr 1 2021, 11:18 PM Closed by commit rG7959d59028dd: [libcxx] adds concepts `std::totally_ordered` and `std::totally_ordered_with` (authored by cjdb). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 334901 libcxx/include/concepts
libcxx/include/type_traits
libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable.compile.pass.cpp
libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable_with.compile.pass.cpp
libcxx/test/std/concepts/concepts.compare/concepts.totallyordered/totally_ordered.pass.cpp
libcxx/test/std/concepts/concepts.compare/concepts.totallyordered/totally_ordered_with.pass.cpp
libcxx/test/std/concepts/concepts.compare/types.h
|
Minor bikeshed; since the standard type traits start with a verb I would like to do the same here. This "trait" is like make_signed_t so I would suggest __make_const_lvalue_ref.