Created on 2025-04-18.00:00:00 last changed 5 months ago
Proposed resolution:
This wording is relative to N5008.
Modify [counted.iterator] as indicated:
namespace std {
template<input_or_output_iterator I>
class counted_iterator {
public:
[…]
friend constexpr iter_difference_t<I> operator-(
const counted_iterator& x, default_sentinel_t) noexcept;
friend constexpr iter_difference_t<I> operator-(
default_sentinel_t, const counted_iterator& y) noexcept;
[…]
friend constexpr bool operator==(
const counted_iterator& x, default_sentinel_t) noexcept;
[…]
};
[…]
}
Modify [counted.iter.nav] as indicated:
friend constexpr iter_difference_t<I> operator-( const counted_iterator& x, default_sentinel_t) noexcept;-15- Effects: Equivalent to:
return -x.length;friend constexpr iter_difference_t<I> operator-( default_sentinel_t, const counted_iterator& y) noexcept;-16- Effects: Equivalent to:
return y.length;
Modify [counted.iter.cmp] as indicated:
friend constexpr bool operator==( const counted_iterator& x, default_sentinel_t) noexcept;-3- Effects: Equivalent to:
return x.length == 0;
[ Sofia 2025-06-21; Status changed: Voting → WP. ]
[ 2025-06-12; Reflector poll ]
Set status to Tentatively Ready after seven votes in favour during reflector poll.
`counted_iterator` can be compared or subtracted from `default_sentinel_t`, which only involves simple integer arithmetic and does not have any Preconditions.
In this case, it is reasonable to declare them asnoexcept.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2025-06-23 16:37:24 | admin | set | messages: + msg14864 |
| 2025-06-23 16:37:24 | admin | set | status: voting -> wp |
| 2025-06-12 20:59:27 | admin | set | status: ready -> voting |
| 2025-06-12 20:55:03 | admin | set | messages: + msg14804 |
| 2025-06-12 20:55:03 | admin | set | status: new -> ready |
| 2025-04-21 10:17:51 | admin | set | messages: + msg14727 |
| 2025-04-18 00:00:00 | admin | create | |