This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++23 status.
base() const &
and lazy_split_view::outer-iterator::value_type::end()
missing noexcept
Section: 24.5.4 [move.iterators], 24.5.7 [iterators.counted], 25.7.8.3 [range.filter.iterator], 25.7.9.3 [range.transform.iterator], 25.7.16.4 [range.lazy.split.outer.value], 25.7.16.5 [range.lazy.split.inner], 25.7.23.3 [range.elements.iterator] Status: C++23 Submitter: Hewill Kang Opened: 2021-09-14 Last modified: 2023-11-22
Priority: Not Prioritized
View all other issues in [move.iterators].
View all issues with C++23 status.
Discussion:
LWG 3391(i) and 3533(i) 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
.
[2021-09-24; Reflector poll]
Set status to Tentatively Ready after seven votes in favour during reflector poll.
[2021-10-14 Approved at October 2021 virtual plenary. Status changed: Voting → WP.]
Proposed resolution:
This wording is relative to N4892.
Modify 24.5.4 [move.iterators], class template move_iterator
synopsis, as indicated:
[…] constexpr const iterator_type& base() const & noexcept; constexpr iterator_type base() &&; […]
Modify 24.5.4.5 [move.iter.op.conv] as indicated:
constexpr const Iterator& base() const & noexcept;-1- Returns:
current
.
Modify 24.5.7.1 [counted.iterator], class template counted_iterator
synopsis, as indicated:
[…] constexpr const I& base() const & noexcept; constexpr I base() &&; […]
Modify 24.5.7.3 [counted.iter.access] as indicated:
constexpr const I& base() const & noexcept;-1- Effects: Equivalent to:
return current;
Modify 25.7.8.3 [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_;
Modify 25.7.9.3 [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_;
Modify 25.7.16.4 [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;
Modify 25.7.16.5 [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;
Modify 25.7.23.3 [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_;