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

3208. Boolean's expression requirements are ordered inconsistently

Section: 24.7 [iterator.range] Status: C++20 Submitter: Casey Carter Opened: 2019-06-06 Last modified: 2021-02-25

Priority: 0

View other active issues in [iterator.range].

View all other issues in [iterator.range].

View all issues with C++20 status.

Discussion:

For consistency of presentation, we should group and order the && and || expression requirements similarly to the == and != expression requirements. Note that the suggested change is not quite editorial: evaluation of requirements for satisfaction has short-circuiting behavior, so the declaration order of requirements is normatively significant in general.

[2019-06-13; Priority to 0 and Status to Tentatively Ready after seven positive votes on the reflector.]

Proposed resolution:

This wording is relative to N4810.

  1. Modify [concept.boolean] as indicated:

    […]
      { b1 } -> ConvertibleTo<bool>;
      { !b1 } -> ConvertibleTo<bool>;
      { b1 &&  a } -> Same<bool>;
      { b1 ||  a } -> Same<bool>;
      { b1 && b2 } -> Same<bool>;
      { b1 &&  a } -> Same<bool>;
      {  a && b2 } -> Same<bool>;
      { b1 || b2 } -> Same<bool>;
      { b1 ||  a } -> Same<bool>;
      {  a || b2 } -> Same<bool>;
      { b1 == b2 } -> ConvertibleTo<bool>;
      { b1 ==  a } -> ConvertibleTo<bool>;
      {  a == b2 } -> ConvertibleTo<bool>;
      { b1 != b2 } -> ConvertibleTo<bool>;
      { b1 !=  a } -> ConvertibleTo<bool>;
      {  a != b2 } -> ConvertibleTo<bool>;
    };