Title
Sorted with respect to comparator (only)
Status
c++23
Section
[alg.sorting.general]
Submitter
Casey Carter

Created on 2022-06-10.00:00:00 last changed 12 months ago

Messages

Date: 2022-07-25.20:32:58

Proposed resolution:

This wording is relative to N4910.

  1. Modify [alg.sorting.general] as indicated:

    -5- A sequence is sorted with respect to a comp and proj for a comparator and projection comp and proj if for every iterator i pointing to the sequence and every non-negative integer n such that i + n is a valid iterator pointing to an element of the sequence,

    bool(invoke(comp, invoke(proj, *(i + n)), invoke(proj, *i)))
    

    is false.

    -?- A sequence is sorted with respect to a comparator comp for a comparator comp if it is sorted with respect to comp and identity{} (the identity projection).

Date: 2022-07-25.00:00:00

[ 2022-07-25 Approved at July 2022 virtual plenary. Status changed: Ready → WP. ]

Date: 2022-07-15.00:00:00

[ 2022-07-15; LWG telecon: move to Ready ]

Date: 2022-06-15.00:00:00

[ 2022-06-21; Reflector poll ]

Set status to Tentatively Ready after eight votes in favour during reflector poll.

Date: 2022-06-10.00:00:00

P0896R4 changed the term of art "sorted with respect to comparator" defined in [alg.sorting.general] paragraph 5 to "sorted with respect to comparator and projection." That proposal updated the algorithm specifications consistently. However, there were uses of the old term outside of [algorithms] that are now without meaning. We should bring back the term "sorted with respect to comparator" to fix that lack.

History
Date User Action Args
2023-11-22 15:47:43adminsetstatus: wp -> c++23
2022-07-25 20:32:58adminsetmessages: + msg12654
2022-07-25 20:32:58adminsetstatus: ready -> wp
2022-07-25 20:28:19adminsetmessages: + msg12628
2022-06-21 11:47:28adminsetmessages: + msg12524
2022-06-21 11:47:28adminsetstatus: new -> ready
2022-06-11 17:55:34adminsetmessages: + msg12497
2022-06-10 00:00:00admincreate