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

P2404 Move-only types for equality_comparable_with, totally_ordered_with, and three_way_comparable_with #1074

Closed
wg21bot opened this issue Jul 30, 2021 · 10 comments · Fixed by cplusplus/draft#5701
Labels
C++23 Targeted at C++23 expedited-library-evolution-electronic-poll Papers that were reviewed on the mailing list and then advanced directly to electronic polling. IS Ship vehicle: IS LWG Library plenary-approved Papers approved for inclusion in their target vehicle by plenary vote. tentatively-ready-for-plenary Reviewed between meetings; ready for a vote.
Milestone

Comments

@wg21bot
Copy link
Collaborator

wg21bot commented Jul 30, 2021

P2404R0 Relaxing equality_comparable_with's and three_way_comparable_with's common reference requirements to (Justin Bassett)

@wg21bot wg21bot added the LWG Library label Jul 30, 2021
@wg21bot wg21bot added this to the 2021-telecon milestone Jul 30, 2021
@cor3ntin cor3ntin added LEWG Library Evolution ready-for-library-evolution-mailing-list-review This paper needs to be discussed on the Library Evolution mailing list and removed LWG Library labels Jul 31, 2021
@brycelelbach brycelelbach added B2 - improvement Bucket 2 as described by P0592: bug fixes, performance improvements, integration fixes for/between e IS Ship vehicle: IS size - medium paper size estimate labels Aug 1, 2021
@brycelelbach brycelelbach added the scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review label Sep 24, 2021
@inbal2l
Copy link
Collaborator

inbal2l commented Nov 5, 2021

The paper was reviewed on LEWG mailing list on 2021-09-13. (D1 with a fix was sent in the mail thread)

Summary

  1. Issue: this is a breaking change. (some suggestions to consider as a DR to C++20)
    It's an incremental improvement over the status quo, the breakage cases are more theoretical than real.
    Outcome: It's agreed that the number of breakages is probably low. There were requests for adding a survey to the paper.

  2. Issue: concerns regarding increasing subsumption algorithm's complexity
    Suggestion to eliminate the disjunction and instead introduce an atomic constraint for (convertible_to<const T&, common_reference_t<...>> || convertible_to<T&&, common_reference_t<...>>)
    Author: Agreed. I'll revise the paper with that. (fixed at D1)

  3. Issue: the change might not be worth our time, since it comes up only in edge case
    Some suggest it's not an edge case (for example: unique_ptr).

  4. Issue: it's not true that the common supertype conversion never needs to happen at runtime
    Some designs require monomorphic functions. Relaxing the requirement that the conversion actually exists and can be called at runtime will break anybody using monomorphic callbacks with proxy iterators.

Additional comments on the topic

  • There's a discussion on whether we should weaken the requirements (to achieve more "accurate" heuristic).
    Few alternative suggestions (should be proposed on a separate paper):
    • Introduce new customization point, trait as follows: bool enable_three_way_comparable_with, bool enable_equality_comparable_with Then replace the requirements on common_reference_t (existence and meeting concept) with just checking for the corresponding enable.
    • Add a separate weakly_equality_comparable_with, partially_ordered_with
      Regarding equality_comparable_with - most people assume it should work with any two objects which are able to use the operator = between them. That is not the case, and the cases for which there are common references don't seem to be the main cases for which this concept would be useful.
      The types for which weakly_equality_comparable_with is most useful for are those types which have inconsistent operator==(T, U) and operator==(T, T) / operator==(U, U). In this case, the operator==(T, U) can actually be an equality (form an equivalence relation), but this equality is not consistent with operator==(T, T) or operator==(U, U); iterator/sentinel operator== is actually a case of this.
    • Not use common_reference_t, but instead use an alternative which can fall back on common_comparison_type_t or to_common_comparison(T, U)
  • Heterogeneous comparison comes up as a topic (additional related comments on the thread: "LEWG(I) Weekly review - P2405R0: nullopt_t and nullptr_t should both have operator and operator==")
  • Relevant proposals: 
    • P0805: Comparing Containers.
    • N3351 (search term: "equational").

Outcome

The proposal generally got good support for fixing / addressing the issue.
Relaxing concepts' requirements and the proposed alternatives were subject to a discussion.
Since it is a breaking change (and potential C++20 DR) it should be discussed in LEWG telecon.

@inbal2l inbal2l removed ready-for-library-evolution-mailing-list-review This paper needs to be discussed on the Library Evolution mailing list scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review labels Nov 5, 2021
@cor3ntin cor3ntin added the needs-revision Paper needs changes before it can proceed label Nov 15, 2021
@jensmaurer jensmaurer removed this from the 2021-telecon milestone Jan 1, 2022
@inbal2l inbal2l changed the title P2404 Relaxing equality_comparable_with's and three_way_comparable_with's common reference requirements to P2404 Move-only types for equality_comparable_with, totally_ordered_with, and three_way_comparable_with Jan 6, 2022
@inbal2l
Copy link
Collaborator

inbal2l commented Jan 10, 2022

Was seen by SG9 (Ranges) on 2021-01-10 (Full Minutes)

Polls

POLL: Forward “D2404R2: Move-only types for equality_comparable_with, totally_ordered_with, and three_way_comparable_with“ to LWEG for C++23

SF F N A SA
1 6 0 0 0

Attendance: 10

Author(s) position: SF

Outcome: Strong Consensus in Favor

Summary

Paper was forwarded to LEWG for C++23. Will be reviewed by LEWG ML review targeting electronic poll.

@inbal2l inbal2l added ready-for-library-evolution-mailing-list-review This paper needs to be discussed on the Library Evolution mailing list scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review and removed needs-revision Paper needs changes before it can proceed labels Jan 10, 2022
@inbal2l inbal2l added the expedited-library-evolution-electronic-poll Papers that were reviewed on the mailing list and then advanced directly to electronic polling. label Jan 18, 2022
@brycelelbach
Copy link

brycelelbach commented Jan 18, 2022

@inbal2l inbal2l added the C++23 Targeted at C++23 label Jan 18, 2022
@brycelelbach brycelelbach added ready-for-library-evolution-electronic-poll This paper needs to undergo a Library Evolution electronic poll size - small paper size estimate and removed ready-for-library-evolution-mailing-list-review This paper needs to be discussed on the Library Evolution mailing list scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review size - medium paper size estimate labels Jan 19, 2022
@wg21bot
Copy link
Collaborator Author

wg21bot commented Jan 22, 2022

P2404R1 Move-only types for equality_comparable_with, totally_ordered_with, and three_way_comparable_with (Justin Bassett)

@wg21bot wg21bot added this to the 2022-telecon milestone Jan 22, 2022
@wg21bot
Copy link
Collaborator Author

wg21bot commented Jan 22, 2022

P2404R2 Move-only types for equality_comparable_with, totally_ordered_with, and three_way_comparable_with (Justin Bassett)

@brycelelbach brycelelbach added scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review and removed scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review labels Feb 1, 2022
@cor3ntin
Copy link

cor3ntin commented Feb 16, 2022

2022-01 Library Evolution Electronic Poll Outcomes

Send [P2404R2] (Move-Only Types For equality_comparable_with, totally_ordered_with, And three_way_comparable_with) to Library Working Group for C++23, classified as an improvement of an existing feature ([P0592R4] bucket 2 item)

SF F N A SA
12 10 3 0 0

Strong consensus in favor.

@cor3ntin cor3ntin added LWG Library and removed LEWG Library Evolution ready-for-library-evolution-electronic-poll This paper needs to undergo a Library Evolution electronic poll scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review expedited-library-evolution-electronic-poll Papers that were reviewed on the mailing list and then advanced directly to electronic polling. labels Feb 16, 2022
@brycelelbach brycelelbach added expedited-library-evolution-electronic-poll Papers that were reviewed on the mailing list and then advanced directly to electronic polling. lwg-pending LWG Chair needs to disposition labels Feb 23, 2022
@jwakely
Copy link
Member

jwakely commented Jul 1, 2022

LWG reviewed this today and asked for a few small edits. We'll see it again next week.

@JeffGarland JeffGarland added lwg-fullreview Paper is ready for lwg full group review and removed lwg-pending LWG Chair needs to disposition labels Jul 4, 2022
@JeffGarland
Copy link
Member

LWG reviewed updates and approved 2022-07-08
Notes: https://wiki.edg.com/bin/view/Wg21telecons2022/P2404-20220708

poll: Put P2403r3 into C++23?

F A N
11 0 1

@JeffGarland JeffGarland added tentatively-ready-for-plenary Reviewed between meetings; ready for a vote. and removed lwg-fullreview Paper is ready for lwg full group review B2 - improvement Bucket 2 as described by P0592: bug fixes, performance improvements, integration fixes for/between e size - small paper size estimate labels Jul 8, 2022
@jwakely
Copy link
Member

jwakely commented Jul 12, 2022

poll: Put P2403r3 into C++23?

This is a typo in the minutes, copied here. It should be P2404R3 of course.

@wg21bot
Copy link
Collaborator Author

wg21bot commented Jul 21, 2022

P2404R3 Move-only types for equality_comparable_with, totally_ordered_with, and three_way_comparable_with (Justin Bassett)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++23 Targeted at C++23 expedited-library-evolution-electronic-poll Papers that were reviewed on the mailing list and then advanced directly to electronic polling. IS Ship vehicle: IS LWG Library plenary-approved Papers approved for inclusion in their target vehicle by plenary vote. tentatively-ready-for-plenary Reviewed between meetings; ready for a vote.
Projects
None yet
7 participants