Title
Several iterators' base() const & and lazy_split_view::outer-iterator::value_type::end() missing noexcept
Status
c++23
Section
[move.iterators][iterators.counted][range.filter.iterator] [range.transform.iterator][range.lazy.split.outer.value][range.lazy.split.inner] [range.elements.iterator]
Submitter
Hewill Kang

Created on 2021-09-14.00:00:00 last changed 12 months ago

Messages

Date: 2021-10-14.09:56:08

Proposed resolution:

This wording is relative to N4892.

  1. Modify [move.iterators], class template move_iterator synopsis, as indicated:

    […]
    constexpr const iterator_type& base() const & noexcept;
    constexpr iterator_type base() &&;
    […]
    
  2. Modify [move.iter.op.conv] as indicated:

    constexpr const Iterator& base() const & noexcept;
    

    -1- Returns: current.

  3. Modify [counted.iterator], class template counted_iterator synopsis, as indicated:

    […]
    constexpr const I& base() const & noexcept;
    constexpr I base() &&;
    […]
    
  4. Modify [counted.iter.access] as indicated:

    constexpr const I& base() const & noexcept;
    

    -1- Effects: Equivalent to: return current;

  5. Modify [range.filter.iterator] as indicated:

    […]
    constexpr const iterator_t<V>& base() const & noexcept;
    constexpr iterator_t<V> base() &&;
    […]
    
    […]
    constexpr const iterator_t<V>& base() const & noexcept;
    

    -5- Effects: Equivalent to: return current_;

  6. Modify [range.transform.iterator] as indicated:

    […]
    constexpr const iterator_t<Base>& base() const & noexcept;
    constexpr iterator_t<Base> base() &&;
    […]
    
    […]
    constexpr const iterator_t<Base>& base() const & noexcept;
    

    -5- Effects: Equivalent to: return current_;

  7. Modify [range.lazy.split.outer.value] as indicated:

    […]
    constexpr inner-iterator<Const> begin() const;
    constexpr default_sentinel_t end() const noexcept;
    […]
    
    […]
    constexpr default_sentinel_t end() const noexcept;
    

    -3- Effects: Equivalent to: return default_sentinel;

  8. Modify [range.lazy.split.inner] as indicated:

    […]
    constexpr const iterator_t<Base>& base() const & noexcept;
    constexpr iterator_t<Base> base() &&;
    […]
    
    […]
    constexpr const iterator_t<Base>& base() const & noexcept;
    

    -3- Effects: Equivalent to: return i_.current;

  9. Modify [range.elements.iterator] as indicated:

    […]
    constexpr const iterator_t<Base>& base() const& noexcept;
    constexpr iterator_t<Base> base() &&;
    […]
    
    […]
    constexpr const iterator_t<Base>& base() const& noexcept;
    

    -6- Effects: Equivalent to: return current_;

Date: 2021-10-14.00:00:00

[ 2021-10-14 Approved at October 2021 virtual plenary. Status changed: Voting → WP. ]

Date: 2021-09-15.00:00:00

[ 2021-09-24; Reflector poll ]

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

Date: 2021-09-14.00:00:00

LWG 3391 and 3533 changed some iterators' base() const & from returning value to returning const reference, which also prevents them from throwing exceptions, we should add noexcept for them. Also, lazy_split_view::outer-iterator::value_type::end() can be noexcept since it only returns default_sentinel.

History
Date User Action Args
2023-11-22 15:47:43adminsetstatus: wp -> c++23
2021-10-14 09:56:08adminsetmessages: + msg12144
2021-10-14 09:56:08adminsetstatus: voting -> wp
2021-09-29 12:57:28adminsetstatus: ready -> voting
2021-09-24 17:55:02adminsetmessages: + msg12074
2021-09-24 17:55:02adminsetstatus: new -> ready
2021-09-18 15:06:39adminsetmessages: + msg12040
2021-09-14 00:00:00admincreate