Skip to content

<compare>,<functional> Concept-constrained comparisons#385

Merged
CaseyCarter merged 25 commits intomicrosoft:masterfrom
AdamBucior:compare
Feb 19, 2020
Merged

<compare>,<functional> Concept-constrained comparisons#385
CaseyCarter merged 25 commits intomicrosoft:masterfrom
AdamBucior:compare

Conversation

@AdamBucior
Copy link
Copy Markdown
Contributor

@AdamBucior AdamBucior commented Dec 13, 2019

Description

Partial implementation of #62

Edit: It's worth to note that this requires compiler intrinsic for BUILTIN-PTR-THREE-WAY

Checklist

Be sure you've read README.md and understand the scope of this repo.

If you're unsure about a box, leave it unchecked. A maintainer will help you.

  • Identifiers in product code changes are properly _Ugly as per
    https://eel.is/c++draft/lex.name#3.1 or there are no product code changes.
  • The STL builds successfully and all tests have passed (must be manually
    verified by an STL maintainer before automated testing is enabled on GitHub,
    leave this unchecked for initial submission).
  • These changes introduce no known ABI breaks (adding members, renaming
    members, adding virtual functions, changing whether a type is an aggregate
    or trivially copyable, etc.).
  • These changes were written from scratch using only this repository,
    the C++ Working Draft (including any cited standards), other WG21 papers
    (excluding reference implementations outside of proposed standard wording),
    and LWG issues as reference material. If they were derived from a project
    that's already listed in NOTICE.txt, that's fine, but please mention it.
    If they were derived from any other project (including Boost and libc++,
    which are not yet listed in NOTICE.txt), you must mention it here,
    so we can determine whether the license is compatible and what else needs
    to be done.

@AdamBucior AdamBucior requested a review from a team as a code owner December 13, 2019 20:55
Copy link
Copy Markdown
Contributor

@CaseyCarter CaseyCarter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's a bit of actionable feedback.

AdamBucior and others added 3 commits December 18, 2019 15:37
Co-Authored-By: Casey Carter <cartec69@gmail.com>
Co-Authored-By: Casey Carter <cartec69@gmail.com>
Copy link
Copy Markdown
Contributor

@CaseyCarter CaseyCarter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine now. I'll pick it up in a week or so, throw together the std::ranges comparison function objects, and write tests for the whole kit at the same time.

@BillyONeal
Copy link
Copy Markdown
Member

@CaseyCarter Should we merge this given that the boolean concept stuff is likely to change in Prague?

Copy link
Copy Markdown
Contributor

@CaseyCarter CaseyCarter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we adding the unused _Synth_three_way_result in this PR?

@CaseyCarter
Copy link
Copy Markdown
Contributor

@CaseyCarter Should we merge this given that the boolean concept stuff is likely to change in Prague?

I'm not concerned with adding more uses of boolean to those that we already have; s/boolean/_Boolean_testable/ will catch them all.

AdamBucior and others added 5 commits January 22, 2020 20:55
Co-Authored-By: Michael Schellenberger Costa <mschellenbergercosta@gmail.com>
Co-Authored-By: Michael Schellenberger Costa <mschellenbergercosta@gmail.com>
Co-Authored-By: Casey Carter <cartec69@gmail.com>
Co-Authored-By: Casey Carter <cartec69@gmail.com>
Co-Authored-By: Casey Carter <cartec69@gmail.com>
@AdamBucior
Copy link
Copy Markdown
Contributor Author

Why are we adding the unused _Synth_three_way_result in this PR?

I thought this PR would be a good place for it even if it's not used yet.

@StephanTLavavej StephanTLavavej added the cxx20 C++20 feature label Feb 5, 2020
`ranges::equal_to`, `ranges::not_equal_to`, `ranges::less`, `ranges::less_equal`, `ranges::greater`, and `ranges::greater_equal`. `ranges::equal_to` and `ranges::less` are in `<xutility>` - to be readily available for algorithms that will appearsoon - with the remainder in `<functional>`.

Ancillary bits:
`<concepts>`: Refactor the comparison concept definitions to avoid redundant requirements for the single-type `equality_comparable`, `totally_ordered`, and `three_way_comparable`.
`<compare>`:
  * ======= BREAK ABI OF `partial_ordering` ======= because (a) Clang wants the comparison category types to be byte-sized, and (b) the "is ordered" boolean is functionally determined by the stored value anyway.
  * Reimplement `common_comparison_category` and `common_comparison_category_t` to perform `n + c` template instantiations instead of `cn` template instantiations.
`<xstddef>`, `<memory>`: Reorder all `is_transparent` declarations in the STL to agree with synopsis order.
@CaseyCarter CaseyCarter changed the title <compare> Concepts And Utilities <compare>,<functional> Concept-constrained comparisons Feb 7, 2020
Copy link
Copy Markdown
Member

@StephanTLavavej StephanTLavavej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😸

* [NFC] weirdness in `<utility>` which closes and immediately reopens `std`
* Silence a -Wsign-compare clang warning in `<algorithm>`
@CaseyCarter CaseyCarter merged commit f01ecbb into microsoft:master Feb 19, 2020
@CaseyCarter
Copy link
Copy Markdown
Contributor

Thanks for your contribution! (And sorry it took so long for me to fight compiler bugs for test cases and/or get back from Prague.)

@AdamBucior AdamBucior deleted the compare branch February 19, 2020 06:24
@CaseyCarter CaseyCarter mentioned this pull request Mar 16, 2020
@CaseyCarter CaseyCarter removed their assignment Jun 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cxx20 C++20 feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants