Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P0768R1 Library Support For The Spaceship Comparison Operator <=> #64

Closed
StephanTLavavej opened this issue Sep 6, 2019 · 6 comments · Fixed by #1370
Closed

P0768R1 Library Support For The Spaceship Comparison Operator <=> #64

StephanTLavavej opened this issue Sep 6, 2019 · 6 comments · Fixed by #1370
Assignees
Labels
cxx20 C++20 feature fixed Something works now, yay!
Milestone

Comments

@StephanTLavavej
Copy link
Member

StephanTLavavej commented Sep 6, 2019

P0768R1 Library Support For The Spaceship Comparison Operator <=>
P1959R0 Removing weak_equality And strong_equality

This was partially implemented in VS 2019 16.0, but some work remains to be done.

This deprecates rel_ops.

Feature-test macro added by WG21-P1353 "Missing Feature Test Macros" (note that this value will be increased by #62 WG21-P1614 "Adding Spaceship <=> To The Library"):
#define __cpp_lib_three_way_comparison 201711L

@StephanTLavavej StephanTLavavej added the cxx20 C++20 feature label Sep 6, 2019
@CaseyCarter
Copy link
Member

CaseyCarter commented Oct 29, 2019

Remaining work: (Note that components of P0768R1 superseded by P1614R2 are not included here)

  • Implement lexicographical_compare_three_way in <algorithm>
  • Don't implement compare_3way, strong_equal, and weak_equal - they are removed by later proposals
  • Implement the [cmp.alg] CPOs from P1614R2:
    • strong_order
    • weak_order
    • partial_order
    • compare_strong_order_fallback
    • compare_weak_order_fallback
    • compare_partial_order_fallback
  • After completing the above, define __cpp_lib_three_way_comparison in yvals_core.h when _HAS_CXX20
  • Throughput tuning for common_comparison_category
  • Deprecate std::rel_ops
  • Implement P1959R0 Removing weak_equality And strong_equality

CaseyCarter added a commit to CaseyCarter/STL that referenced this issue Oct 31, 2019
WG21-P1614 "The Mothership has Landed" added `==` operators to the comparison category types (`weak_equality`, `strong_equality`, `partial_ordering`, `weak_ordering`, and `strong_ordering`) defined in `<compare>`. This PR implements those operators to bring the comparison category types up to spec once again. It also implements P1614R2's removal of operators that rewrite into calls to `operator==(X, nullptr_t)` for each comparison category type `X`.

Drive-by changes:
* Move the TODO list of tasks for WG21-P0768 "Library Support for the Spaceship (Comparison) Operator" completion out of `<compare>` and into microsoft#64
* Remove the `#if 0 // Not yet implemented` block from `<compare>`
CaseyCarter added a commit that referenced this issue Nov 1, 2019
WG21-P1614 "The Mothership has Landed" added `==` operators to the comparison category types (`weak_equality`, `strong_equality`, `partial_ordering`, `weak_ordering`, and `strong_ordering`) defined in `<compare>`. This PR implements those operators to bring the comparison category types up to spec once again. It also implements P1614R2's removal of operators that rewrite into calls to `operator==(X, nullptr_t)` for each comparison category type `X`.

Drive-by changes:
* Move the TODO list of tasks for WG21-P0768 "Library Support for the Spaceship (Comparison) Operator" completion out of `<compare>` and into #64
* Remove the `#if 0 // Not yet implemented` block from `<compare>`
StephanTLavavej pushed a commit that referenced this issue Dec 13, 2019
Implement WG21-P1959 Removing `weak_equality` And `strong_equality`, working towards #64.
@AdamBucior
Copy link
Contributor

I have lexicographical_compare_three_way implementation ready but I wait with it for #385 to be merged because it requires compare_three_way.

@StephanTLavavej
Copy link
Member Author

@CaseyCarter, looking at your checklist above, is this paper complete except for the feature-test macro update?

@CaseyCarter
Copy link
Member

@CaseyCarter, looking at your checklist above, is this paper complete except for the feature-test macro update?

I struck features from the list that were removed or replaced by later proposals. That makes sense for removals, but for replacements we should implement the replacement feature before defining the feature-test macro. I've updated the list to mention both removals and replacements.

TLDR: We still need to define the (strong|partial|weak)_order customization point objects before defining the feature-test macro.

@AdamBucior
Copy link
Contributor

Looking at the Changelog it seems that P1959R0 Removing weak_equality And strong_equality is missing. Not sure if it's intentional. (The PR that implemented it: #381)

@CaseyCarter
Copy link
Member

Looking at the Changelog it seems that P1959R0 Removing weak_equality And strong_equality is missing. Not sure if it's intentional. (The PR that implemented it: #381)

Good catch, @AdamBucior. This was simply an oversight. I've added a mention of P1959R0 to the 16.5 section of the Changelog. Thanks!

@StephanTLavavej StephanTLavavej self-assigned this Apr 29, 2020
@cbezault cbezault added this to the Conformance milestone May 7, 2020
@StephanTLavavej StephanTLavavej added this to Available in C++20 Features May 17, 2020
@StephanTLavavej StephanTLavavej added this to Reference in P1614R2 Spaceship Jul 3, 2020
@StephanTLavavej StephanTLavavej removed this from Reference in P1614R2 Spaceship Jul 3, 2020
@StephanTLavavej StephanTLavavej moved this from Available to Investigating in C++20 Features Jul 9, 2020
@StephanTLavavej StephanTLavavej moved this from Investigating to Reviewing PR in C++20 Features Oct 14, 2020
C++20 Features automation moved this from Reviewing PR to Done Oct 29, 2020
@StephanTLavavej StephanTLavavej added fixed Something works now, yay! and removed work in progress labels Oct 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cxx20 C++20 feature fixed Something works now, yay!
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

4 participants