Movatterモバイル変換


[0]ホーム

URL:



This page is a snapshot from the LWG issues list, see theLibrary Active Issues List for more information and the meaning ofC++20 status.

3324. Special-casestd::strong/weak/partial_order for pointers

Section: 17.12.6[cmp.alg]Status:C++20Submitter: CanadaOpened: 2019-11-06Last modified: 2021-02-25

Priority:0

View otheractive issues in [cmp.alg].

View all otherissues in [cmp.alg].

View all issues withC++20 status.

Discussion:

AddressesCA 178

std::strong_order,weak_order, andpartial_order have special cases for floating point, but are missing special casing for pointers.compare_three_way andstd::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:

Usecompare_three_way instead of<=> for the various comparison algorithms.

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

Proposed resolution:

This wording is relative toN4835.

  1. Change 17.12.6[cmp.alg] as indicated:

    -1- The namestrong_order […]

    1. […]

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

    3. […]

    -2- The nameweak_order […]

    1. […]

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

    3. […]

    -3- The namepartial_order […]

    1. […]

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

    3. […]


[8]ページ先頭

©2009-2026 Movatter.jp