Title
lazy_split_view::outer-iterator's const-converting constructor isn't setting trailing_empty_
Status
wp
Section
[range.lazy.split.outer]
Submitter
Patrick Palka

Created on 2023-03-13.00:00:00 last changed 18 months ago

Messages

Date: 2023-06-19.14:50:03

Proposed resolution:

This wording is relative to N4928.

  1. Modify [range.lazy.split.outer] as indicated:

    constexpr outer-iterator(outer-iterator<!Const> i)
      requires Const && convertible_to<iterator_t<V>, iterator_t<Base>>;
    

    -4- Effects: Initializes parent_ with i.parent_, and current_ with std::move(i.current_), and trailing_empty_ with i.trailing_empty_.

Date: 2023-06-17.00:00:00

[ 2023-06-17 Approved at June 2023 meeting in Varna. Status changed: Voting → WP. ]

Date: 2023-05-15.00:00:00

[ 2023-05-24; Reflector poll ]

Set status to Tentatively Ready after five votes in favour during reflector poll.

Date: 2023-03-13.00:00:00

It seems the const-converting constructor for lazy_split_view's iterator fails to propagate trailing_empty_ from the argument, which effectively results in the trailing empty range getting skipped over:

auto r = views::single(0) | views::lazy_split(0); // r is { {}, {} }
auto i = r.begin();
++i; // i.trailing_empty_ is correctly true
decltype(std::as_const(r).begin()) j = i; // j.trailing_empty_ is incorrectly false
auto k = r.end(); // k.trailing_empty_ is correctly false, and we wrongly have j == k
History
Date User Action Args
2023-06-19 14:50:03adminsetmessages: + msg13649
2023-06-19 14:50:03adminsetstatus: voting -> wp
2023-06-12 08:52:25adminsetstatus: ready -> voting
2023-05-24 14:04:16adminsetmessages: + msg13557
2023-05-24 14:04:16adminsetstatus: new -> ready
2023-03-18 14:42:23adminsetmessages: + msg13456
2023-03-13 00:00:00admincreate