Created on 2021-03-21.00:00:00 last changed 4 weeks ago
[ 2021-03-21; Daniel comments ]
There is intentionally no P/R provided at this point, but I'm volunteering to provide it if we got feedback whether adding conditional noexcept specifiers similar to those provided by LWG 2280 would be preferred or not.
Overloads for std::rbegin/rend for built-in arrays and std::initializer_list's has no preconditions and never throw exceptions, thus should be noexcept. LWG 2280 addressed a similar issue for std::begin/end.Suggestion: change these declarations in [iterator.range] (p10, 11, 12, 13) as indicated:
template<class T, size_t N> constexpr reverse_iterator<T*> rbegin(T (&array)[N]) ; template<class T, size_t N> constexpr reverse_iterator<T*> rend(T (&array)[N]) ; template<class E> constexpr reverse_iterator<const E*> rbegin(initializer_list<E> il) ; template<class E> constexpr reverse_iterator<const E*> rend(initializer_list<E> il) ;
If this change is accepted, we may also specify conditional noexcept for std::crbegin/crend (in [iterator.range] p14, 15), by adding noexcept(noexcept(std::rbegin/crend(c))), like in LWG 2280.Conditional noexcept for other functions in [iterator.range] (p2, 3, 7, 8, 16, 18, 20 22) may also be added for consistency.
|2021-03-21 19:01:47||admin||set||messages: + msg11754|