Title
totally_ordered_with both directly and indirectly requires common_reference_with
Status
c++20
Section
[concept.totallyordered]
Submitter
United States

Created on 2019-11-07.00:00:00 last changed 38 months ago

Messages

Date: 2019-11-08.12:06:23

Proposed resolution:

This wording is relative to N4835.

  1. Change [concept.totallyordered] as indicated:

    For some type T, let a, b, and c be lvalues of type const remove_reference_t<T>. T models totally_ordered only if

    1. (1.1) — Exactly one of bool(a < b), bool(a > b), or bool(a == b) is true.

    2. (1.2) — If bool(a < b) and bool(b < c), then bool(a < c).

    3. (1.3) — bool(a > b) == bool(b < a).

    4. (1.4) — bool(a <= b) == !bool(b < a).

    5. (1.5) — bool(a >= b) == !bool(a < b).

    template<class T, class U>
      concept totally_ordered_with =
        totally_ordered<T> && totally_ordered<U> &&
        common_reference_with<const remove_reference_t<T>&, const remove_reference_t<U>&> &&
        equality_comparable_with<T, U> &&
        totally_ordered<
          common_reference_t<
            const remove_reference_t<T>&,
            const remove_reference_t<U>&>> &&
        equality_comparable_with<T, U> &&
        requires(const remove_reference_t<T>& t,
                 const remove_reference_t<U>& u) {
          { t <  u } -> boolean;
          { t >  u } -> boolean;
          { t <= u } -> boolean;
          { t >= u } -> boolean;
          { u <  t } -> boolean;
          { u >  t } -> boolean;
          { u <= t } -> boolean;
          { u >= t } -> boolean;
        };
    
Date: 2019-11-08.12:06:23

[ 2019-11 Moved to Ready on Friday AM in Belfast ]

Date: 2019-11-07.00:00:00

Addresses US 201

The totally_ordered_with<T, U> redundantly requires both common_reference_with<const remove_reference_t&, const remove_reference_t&> and equality_comparable_with<T, U> (which also has the common_reference_with requirement). The redundant requirement should be removed.

Proposed change:

Change the definition of totally_ordered_with to:

template<class T, class U>
  concept totally_ordered_with =
    totally_ordered<T> && totally_ordered<U> &&
    equality_comparable_with<T, U> &&
    totally_ordered<
      common_reference_t<
        const remove_reference_t<T>&,
        const remove_reference_t<U<&>> &&
    requires(const remove_reference_t<T<& t,
                    const remove_reference_t>U>& u) {
      [… as before …]
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-08 12:06:23adminsetmessages: + msg10805
2019-11-08 12:06:23adminsetstatus: new -> ready
2019-11-07 19:28:47adminsetmessages: + msg10799
2019-11-07 00:00:00admincreate