Created on 2019-10-03.00:00:00 last changed 45 months ago
Proposed resolution:
This wording is relative to N4830.
Modify [range.transform.iterator] as indicated:
-2- iterator::iterator_category is defined as follows: Let C denote the type iterator_traits<iterator_t<Base>>::iterator_category.
(2.?) — If is_lvalue_reference_v<invoke_result_t<F&, range_reference_t<Base>>> is true,
(2.?.?) — If C models derived_from<contiguous_iterator_tag>, then iterator_category denotes random_access_iterator_tag;
(2.?.?) — O
otherwise, iterator_category denotes C.(2.?) — Otherwise, iterator_category denotes input_iterator_tag.
[ 2020-02-10 Move to Immediate Monday afternoon in Prague ]
[ 2019-11-06, Tim updates P/R based on Belfast LWG evening session discussion ]
The check in the original P/R is incorrect; we want to check the transformation's result, not the base iterator.
[ 2019-10-31 Issue Prioritization ]
Priority to 1 after reflector discussion.
Previous resolution [SUPERSEDED]:This wording is relative to N4830.
Modify [range.transform.iterator] as indicated:
-2- iterator::iterator_category is defined as follows: Let C denote the type iterator_traits<iterator_t<Base>>::iterator_category.
(2.?) — If is_lvalue_reference_v<iter_reference_t<iterator_t<Base>>> is true,
(2.?.?) — If C models derived_from<contiguous_iterator_tag>, then iterator_category denotes random_access_iterator_tag;
(2.?.?) — O
otherwise, iterator_category denotes C.(2.?) — Otherwise, iterator_category denotes input_iterator_tag.
When the transformation function returns an rvalue, transform_view::iterator cannot model cpp17-forward-iterator. However, similar to LWG 3291, the current wording on transform_view::iterator::iterator_category does not consider this.
As Casey Carter pointed out here, the proposed wording below does not consider input_iterator that is not cpp17-input-iterator (this problem is not specific to the PR; it's pervasive in adapted iterators) and concepts-based determination would be a better fix for issues around iterator_category. But anyway, I consider this PR as a minimal fix at the moment.History | |||
---|---|---|---|
Date | User | Action | Args |
2021-02-25 10:48:01 | admin | set | status: wp -> c++20 |
2020-02-24 16:02:59 | admin | set | status: immediate -> wp |
2020-02-10 19:48:51 | admin | set | messages: + msg11033 |
2020-02-10 19:48:51 | admin | set | status: new -> immediate |
2019-11-06 22:59:16 | admin | set | messages: + msg10770 |
2019-10-31 19:35:45 | admin | set | messages: + msg10720 |
2019-10-10 18:16:07 | admin | set | messages: + msg10692 |
2019-10-03 00:00:00 | admin | create |