Title
decay in viewable_range should be remove_cvref
Status
c++20
Section
[range.refinements]
Submitter
Casey Carter

Created on 2020-01-14.00:00:00 last changed 38 months ago

Messages

Date: 2020-02-13.12:32:11

Proposed resolution:

This wording is relative to N4849.

  1. Modify [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>>);
    
Date: 2020-02-13.12:32:11

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

Date: 2020-02-06.00:00:00

[ 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.

Date: 2020-02-01.00:00:00

[ 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 [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>>);
    
Date: 2020-01-14.00:00:00

The viewable_range concept is defined in [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.]

History
Date User Action Args
2021-02-25 10:48:01adminsetstatus: wp -> c++20
2020-02-24 16:02:59adminsetstatus: immediate -> wp
2020-02-13 12:32:11adminsetmessages: + msg11063
2020-02-13 12:32:11adminsetstatus: open -> immediate
2020-02-06 19:36:01adminsetmessages: + msg10983
2020-02-06 19:36:01adminsetstatus: ready -> open
2020-02-01 13:27:02adminsetmessages: + msg10976
2020-02-01 13:27:02adminsetstatus: new -> ready
2020-01-18 19:19:12adminsetmessages: + msg10951
2020-01-14 00:00:00admincreate