Created on 2020-10-28.00:00:00 last changed 12 months ago
Proposed resolution:
This wording is relative to N4868.
This wording intentionally only touches operator++(int) and not operator-, see the 2020-11-01 comment for the reason why.
Modify [range.elements.iterator], class template elements_view::iterator synopsis, as indicated:
[…][…] constexpr iterator& operator++(); constexpr void operator++(int)requires (!forward_range<Base>); constexpr iterator operator++(int) requires forward_range<Base>; […]constexpr void operator++(int)requires (!forward_range<Base>);-6- Effects: Equivalent to: ++current_.
constexpr iterator operator++(int) requires forward_range<Base>;[…]
[ 2021-02-26 Approved at February 2021 virtual plenary. Status changed: Tentatively Ready → WP. ]
[ 2020-11-15; Reflector prioritization ]
Set priority to 0 and status to Tentatively Ready after five votes in favour during reflector discussions.
[ 2020-11-01; Daniel comments ]
Bullet (2) of the discussion has already been resolved by LWG 3483, it has therefore been omitted from the proposed wording below.
During code review of elements_view for MSVC-STL we found two issues that should be easily addressed:
elements_view::iterator constraints both operator++(int) member functions
constexpr void operator++(int) requires (!forward_range<Base>); constexpr iterator operator++(int) requires forward_range<Base>;
However, given that a constrained method would be preferred we only need to constrain one of those. The proposal would be to remove the constraint from the void returning overload and change the declaration to
constexpr void operator++(int); constexpr iterator operator++(int) requires forward_range<Base>;
elements_view::iterator operator- is constrained as follows:
friend constexpr difference_type operator-(const iterator& x, const iterator& y) requires random_access_range<Base>;
However, that requires its base to have operator- defined. We should change the constraint to sized_sentinel_for<iterator_t<Base>, iterator_t<Base>>:
friend constexpr difference_type operator-(const iterator& x, const iterator& y) requires sized_sentinel_for<iterator_t<Base>, iterator_t<Base>>;
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-11-22 15:47:43 | admin | set | status: wp -> c++23 |
2021-02-26 17:31:29 | admin | set | messages: + msg11702 |
2021-02-26 17:31:29 | admin | set | status: ready -> wp |
2020-11-15 13:41:13 | admin | set | messages: + msg11605 |
2020-11-15 13:41:13 | admin | set | status: new -> ready |
2020-11-01 16:20:16 | admin | set | messages: + msg11522 |
2020-11-01 16:20:16 | admin | set | messages: + msg11521 |
2020-10-28 00:00:00 | admin | create |