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.
view_interface::cbeginSection: 25.5.3 [view.interface] Status: New Submitter: Hewill Kang Opened: 2026-04-19 Last modified: 2026-05-29
Priority: 3
View other active issues in [view.interface].
View all other issues in [view.interface].
View all issues with New status.
Discussion:
The view_interface can provide only a const cbegin member when the derived class is
simple-view, which helps reduce template instantiation.
[2026-05-29; Reflector poll.]
Set priority to 3 after reflector poll.
This does not seem to eliminate class template instantiations, so may not be an improvement. Would benefit from benchmarks.
We could go even further and replace !simple_range<R>,
with !input_range<const R>, due to ranges::cbegin and
ranges::cend using possibly-constant-range.
Proposed resolution:
This wording is relative to N5032.
Modify 25.5.3 [view.interface] as indicated:
namespace std::ranges {
template<class D>
requires is_class_v<D> && same_as<D, remove_cv_t<D>>
class view_interface {
[…]
public:
[…]
constexpr auto cbegin() requires input_range<D> && (!simple-view<D>) {
return ranges::cbegin(derived());
}
constexpr auto cbegin() const requires input_range<const D> {
return ranges::cbegin(derived());
}
constexpr auto cend() requires input_range<D> && (!simple-view<D>) {
return ranges::cend(derived());
}
constexpr auto cend() const requires input_range<const D> {
return ranges::cend(derived());
}
[…]
};
}