Title
Resolve C++20 NB comments US 273 and GB 274
Status
c++20
Section
[ranges.syn]
Submitter
United States/Great Britain

Created on 2019-11-08.00:00:00 last changed 37 months ago

Messages

Date: 2020-02-10.19:48:51

Proposed resolution:

This wording is relative to N4835.

  1. Change [ranges.syn], header <ranges> synopsis, as indicated:

    #include <initializer_list>
    #include <iterator>
    
    namespace std::ranges {
      […]
      // [range.range], ranges
      template<class T>
      concept range = see below;
      […]
      template<range R>
        using range_difference_t = iter_difference_t<iterator_t<R>>;
      template<sized_range R>
        using range_size_t = decltype(ranges::size(declval<R&>()));
      template<range R>
        using range_value_t = iter_value_t<iterator_t<R>>;
      […]
      // [range.ref.view], all view
      namespace views { inline constexpr unspecified all = unspecified; }
        inline constexpr unspecified all = unspecified;
    
        template<viewable_range R>
          using all_tview = decltype(views::all(declval<R>()));
      }
      […]
    }
    
  2. Globally replace all occurrences of all_view with views::all_t. There are 36 occurrences in addition to the definition in the <ranges> synopsis that was changed above.

Date: 2020-02-10.00:00:00

[ 2020-02-10 Move to Immediate Monday afternoon in Prague ]

Date: 2019-11-23.00:00:00

[ 2019-11-23 Issue Prioritization ]

Priority to 1 after reflector discussion.

Date: 2019-11-08.00:00:00

Addresses US 273/GB 274

US 273:

all_view is not a view like the others. For the other view types, foo_view{args...} is a valid way to construct an instance of type foo_view. However, all_view is just an alias to the type of view::all(arg), which could be one of several different types. all_view feels like the wrong name.

Proposed change:

Suggest renaming all_view to all_t and moving it into the views:: namespace.

GB 274:

Add range_size_t.

LEWG asked that range_size_t be removed from P1035, as they were doing a good job of being neutral w.r.t whether or not size-types were signed or unsigned at the time. Now that we've got a policy on what size-types are, and that P1522 and P1523 have been adopted, it makes sense for there to be a range_size_t.

Proposed change:

Add to [ranges.syn]:

template<range R>
  using range_difference_t = iter_difference_t<iterator_t<R>>;
template<sized_range R>
  using range_size_t = decltype(ranges::size(declval<R&>()));

David Olsen:

The proposed wording has been approved by LEWG and LWG in Belfast.

History
Date User Action Args
2021-02-25 10:48:01adminsetstatus: wp -> c++20
2020-02-24 16:02:59adminsetstatus: immediate -> wp
2020-02-10 19:48:51adminsetmessages: + msg11034
2020-02-10 19:48:51adminsetstatus: new -> immediate
2019-11-23 16:10:15adminsetmessages: + msg10841
2019-11-16 17:05:27adminsetmessages: + msg10820
2019-11-08 00:00:00admincreate