Title
enumerate_view::iterator::operator- should be noexcept
Status
wp
Section
[range.enumerate.iterator]
Submitter
Hewill Kang

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

Messages

Date: 2023-06-19.14:50:03

Proposed resolution:

This wording is relative to n4944.

  1. Modify [range.enumerate.iterator] as indicated:

    
    namespace std::ranges {
      template<view V>
        requires range-with-movable-references<V>
      template<bool Const>
      class enumerate_view<V>::iterator {
        […]
        public:
        […]
        friend constexpr difference_type operator-(const iterator& x, const iterator& y) noexcept;
        […]
      }
      […]
    }
    
    […]
    
    friend constexpr difference_type operator-(const iterator& x, const iterator& y) noexcept;
    

    -19- Effects: Equivalent to: return x.pos_ - y.pos_;

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-27.00:00:00

The distance between two enumerate_view::iterator is calculated by subtracting two integers, which never throws.

History
Date User Action Args
2023-06-19 14:50:03adminsetmessages: + msg13651
2023-06-19 14:50:03adminsetstatus: voting -> wp
2023-06-12 08:52:25adminsetstatus: ready -> voting
2023-05-24 14:11:02adminsetmessages: + msg13561
2023-05-24 14:11:02adminsetstatus: new -> ready
2023-03-27 16:44:02adminsetmessages: + msg13500
2023-03-27 00:00:00admincreate