Title
Special-case std::strong/weak/partial_order for pointers
Status
c++20
Section
[cmp.alg]
Submitter
Canada

Created on 2019-11-06.00:00:00 last changed 46 months ago

Messages

Date: 2019-11-07.08:02:35

Proposed resolution:

This wording is relative to N4835.

  1. Change [cmp.alg] as indicated:

    -1- The name strong_order […]

    1. […]

    2. (1.4) — Otherwise, strong_ordering(E <=> Fcompare_three_way()(E, F)) if it is a well-formed expression.

    3. […]

    -2- The name weak_order […]

    1. […]

    2. (2.4) — Otherwise, weak_ordering(E <=> Fcompare_three_way()(E, F)) if it is a well-formed expression.

    3. […]

    -3- The name partial_order […]

    1. […]

    2. (3.3) — Otherwise, partial_ordering(E <=> Fcompare_three_way()(E, F)) if it is a well-formed expression.

    3. […]

Date: 2019-11-07.08:02:35

[ 2019-11 Status to Ready during Wednesday night issue processing in Belfast. ]

Date: 2019-11-06.00:00:00

Addresses CA 178

std::strong_order, weak_order, and partial_order have special cases for floating point, but are missing special casing for pointers. compare_three_way and std::less have the special casing for pointers.

Proposed change:

Change [cmp.alg] bullet 1.4 from
"Otherwise, strong_ordering(E <=> F) if it is a well-formed expression."
to
"Otherwise, strong_ordering(compare_three_way()(E, F)) if it is a well-formed expression."

Change [cmp.alg] bullet 2.4 from
"Otherwise, weak_ordering(E <=> F) if it is a well-formed expression."
to
"Otherwise, weak_ordering(compare_three_way()(E, F)) if it is a well-formed expression."
Change [cmp.alg] bullet 3.3 from
"Otherwise, partial_ordering(E <=> F) if it is a well-formed expression."
to
"Otherwise, partial_ordering(compare_three_way()(E, F)) if it is a well-formed expression."

Dietmar Kühl:

Use compare_three_way instead of <=> for the various comparison algorithms.

History
Date User Action Args
2021-02-25 10:48:01adminsetstatus: wp -> c++20
2020-02-24 16:02:59adminsetstatus: voting -> wp
2020-01-17 04:54:50adminsetstatus: ready -> voting
2019-11-07 08:02:35adminsetmessages: + msg10775
2019-11-07 08:02:35adminsetstatus: new -> ready
2019-11-06 20:09:41adminsetmessages: + msg10764
2019-11-06 00:00:00admincreate