Date
2023-11-18.11:26:51
Message id
13859

Content

Proposed resolution:

This wording is relative to N4964.

  1. Modify [range.drop.view] as indicated:

    constexpr auto begin()
      requires (!(simple-view<V> &&
                  random_access_range<const V> && sized_range<const V>));
    constexpr auto begin() const
      requires random_access_range<const V> && sized_range<const V>;
    

    -3- Returns:

    1. (?.?) — If V models random_access_range and sized_range,

      ranges::begin(base_) + (ranges::distance(base_) - range_difference_t<V>(size()))
      
    2. (?.?) — Otherwise, ranges::next(ranges::begin(base_), count_, ranges::end(base_)).

    -4- Remarks: In order to provide the amortized constant-time complexity required by the range concept when Vdrop_view does not models random_access_range and sized_rangeforward_range, this functionthe first overload caches the result within the drop_view for use on subsequent calls.

    [Note 1: Without this, applying a reverse_view over a drop_view would have quadratic iteration complexity. — end note]

    
    constexpr auto begin() const
      requires random_access_range<const V> && sized_range<const V>;
    

    -?- Returns: ranges::begin(base_) + (ranges::distance(base_) - range_difference_t<const V>(size())).