Title
split_view<V, P>::inner-iterator<true>::operator++(int) should depend on Base
Status
new
Section
[range.split.inner]
Submitter
Casey Carter

Created on 2021-03-11.00:00:00 last changed 1 month ago

Messages

Date: 2021-03-13.13:54:03

Proposed resolution:

This wording is relative to N4878.

  1. Modify [range.split.inner] as indicated:

    constexpr decltype(auto) operator++(int) {
      if constexpr (forward_range<VBase>) {
        auto tmp = *this;
        ++*this;
        return tmp;
      } else
        ++*this;
    }
    
Date: 2021-03-11.00:00:00

split_view<V, P>::inner-iterator<Const>::operator++(int) is specified directly in the synopsis in [range.split.inner] as:

constexpr decltype(auto) operator++(int) {
  if constexpr (forward_range<V>) {
    auto tmp = *this;
    ++*this;
    return tmp;
  } else
    ++*this;
}

The dependency on the properties of V here is odd given that we are wrapping an iterator obtained from a maybe-const<Const, V> (aka Base). It seems like this function should instead be concerned with forward_range<Base>.

History
Date User Action Args
2021-03-13 13:54:03adminsetmessages: + msg11743
2021-03-11 00:00:00admincreate