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.

3375. decay in viewable_range should be remove_cvref

Section: 25.4.5 [range.refinements] Status: C++20 Submitter: Casey Carter Opened: 2020-01-14 Last modified: 2021-02-25

Priority: 0

View all other issues in [range.refinements].

View all issues with C++20 status.

Discussion:

The viewable_range concept is defined in 25.4.5 [range.refinements] as:

template<class T>
  concept viewable_range =
    range<T> && (safe_range<T> || view<decay_t<T>>);

Since neither pointer types, array types, nor function types model view, view<decay_t<T>> here could simplified to view<remove_cvref_t<T>>. The use of decay_t is an artifact of the Ranges TS being based on C++14 which didn't have remove_cvref_t. [Note that the proposed change is not purely editorial since the difference is observable to subsumption.]

[2020-02-01 Status set to Tentatively Ready after five positive votes on the reflector.]

Previous resolution [SUPERSEDED]:

This wording is relative to N4842.

  1. Modify 25.4.5 [range.refinements] as indicated:

    -4- The viewable_range concept specifies the requirements of a range type that can be converted to a view safely.

    template<class T>
      concept viewable_range =
        range<T> && (safe_range<T> || view<decay_tremove_cvref<T>>);
    

[2020-02-06 Casey provides a corrected P/R]

... in response to Jonathan's observation that remove_cvref<T> is both the wrong type and not what the discussion argues for.

[2020-02 Status to Immediate on Thursday morning in Prague.]

Proposed resolution:

This wording is relative to N4849.

  1. Modify 25.4.5 [range.refinements] as indicated:

    -4- The viewable_range concept specifies the requirements of a range type that can be converted to a view safely.

    template<class T>
      concept viewable_range =
        range<T> && (safe_range<T> || view<decay_tremove_cvref_t<T>>);