This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.
enumerate_view::iterator and cartesian_product_view::iterator should not
always provide iterator_categorySection: 25.7.24.3 [range.enumerate.iterator], 25.7.33.3 [range.cartesian.iterator] Status: New Submitter: Hewill Kang Opened: 2024-07-07 Last modified: 2025-10-21
Priority: 3
View other active issues in [range.enumerate.iterator].
View all other issues in [range.enumerate.iterator].
View all issues with New status.
Discussion:
These two iterators do not support *r++ for non-forward iterators,
so we should not provide iterator_category as they are not C++17 iterators.
[2025-10-21; Reflector poll.]
Set priority to 3 after reflector poll.
Six votes for Tentatively Ready, but not unanimous.
Proposed resolution:
This wording is relative to N4981.
Modify 25.7.24.3 [range.enumerate.iterator] as indicated:
namespace std::ranges {
template<view V>
requires range-with-movable-references<V>
template<bool Const>
class enumerate_view<V>::iterator {
using Base = maybe-const<Const, V>; // exposition only
public:
using iterator_category = input_iterator_tag; // present only if Base
// models forward_range
using iterator_concept = see below;
[…]
};
}
Modify 25.7.33.3 [range.cartesian.iterator] as indicated:
namespace std::ranges {
template<input_range First, forward_range... Vs>
requires (view<First> && ... && view<Vs>)
template<bool Const>
class cartesian_product_view<First, Vs...>::iterator {
public:
using iterator_category = input_iterator_tag; // present only if maybe-const<Const, First>
// models forward_range
using iterator_concept = see below;
[…]
};
}