Created on 2023-11-11.00:00:00 last changed 8 months ago
Proposed resolution:
This wording is relative to N4964.
Modify [range.common.view] as indicated:
namespace std::ranges { template<view V> requires (!common_range<V> && copyable<iterator_t<V>>) class common_view : public view_interface<common_view<V>> { private: V base_ = V(); // exposition only public: […] constexpr auto begin() requires (!simple-view<V>) { if constexpr (random_access_range<V> && sized_range<V>) return ranges::begin(base_); else return common_iterator<iterator_t<V>, sentinel_t<V>>(ranges::begin(base_)); } constexpr auto begin() const requires range<const V> { if constexpr (random_access_range<const V> && sized_range<const V>) return ranges::begin(base_); else return common_iterator<iterator_t<const V>, sentinel_t<const V>>(ranges::begin(base_)); } constexpr auto end() requires (!simple-view<V>) { if constexpr (random_access_range<V> && sized_range<V>) return ranges::begin(base_) + ranges::distance(base_); else return common_iterator<iterator_t<V>, sentinel_t<V>>(ranges::end(base_)); } constexpr auto end() const requires range<const V> { if constexpr (random_access_range<const V> && sized_range<const V>) return ranges::begin(base_) + ranges::distance(base_); else return common_iterator<iterator_t<const V>, sentinel_t<const V>>(ranges::end(base_)); } […] }; […] }
[ Tokyo 2024-03-23; Status changed: Voting → WP. ]
[ 2024-03-11; Reflector poll ]
Set status to Tentatively Ready after six votes in favour during reflector poll.
common_view::begin/end have exactly the same implementation as their corresponding const versions, which implies that when the underlying V satisfies simple-view, it is sufficient to just provide const-qualified members.
History | |||
---|---|---|---|
Date | User | Action | Args |
2024-04-02 10:29:12 | admin | set | messages: + msg14036 |
2024-04-02 10:29:12 | admin | set | status: voting -> wp |
2024-03-18 09:32:04 | admin | set | status: ready -> voting |
2024-03-11 21:36:25 | admin | set | messages: + msg13974 |
2024-03-11 21:36:25 | admin | set | status: new -> ready |
2023-11-18 12:51:15 | admin | set | messages: + msg13865 |
2023-11-11 00:00:00 | admin | create |