Title
transform_view::sentinel has an incorrect operator-
Status
c++20
Section
[range.transform.sentinel]
Submitter
Ville Voutilainen

Created on 2020-01-31.00:00:00 last changed 46 months ago

Messages

Date: 2020-02-10.19:13:13

Proposed resolution:

This wording is relative to N4849.

  1. Modify [range.transform.sentinel] as indicated:

    friend constexpr range_difference_t<Base>
      operator-(const sentinel& y, const iterator<Const>& x)
        requires sized_sentinel_for<sentinel_t<Base>, iterator_t<Base>>;
    

    -6- Effects: Equivalent to: return xy.end_ - yx.current_;

Date: 2020-02-10.19:13:13

[ 2020-02 Prioritized as IMMEDIATE Monday morning in Prague ]

Date: 2020-01-31.00:00:00
  1. transform_view::iterator has an exposition-only member current_ ([range.transform.iterator])

  2. transform_view::sentinel has an exposition-only member end_ ([range.transform.sentinel])

  3. at [range.transform.sentinel]/6 we have:

friend constexpr range_difference_t<Base>
  operator-(const sentinel& y, const iterator<Const>& x)
    requires sized_sentinel_for<sentinel_t<Base>, iterator_t<Base>>;

Effects: Equivalent to: return x.end_ - y.current_;

x is an iterator, so it has current_, not end_. y is a sentinel, so it has end_, not current_.

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:13:13adminsetmessages: + msg11019
2020-02-10 19:13:13adminsetstatus: new -> immediate
2020-02-01 14:01:28adminsetmessages: + msg10980
2020-01-31 00:00:00admincreate