Created on 2022-09-05.00:00:00 last changed 12 months ago
Proposed resolution:
This wording is relative to n4917.
Modify [ranges.syn], header <ranges> synopsis, as indicated:
#include <compare> // see [compare.syn] #include <initializer_list> // see [initializer.list.syn] #include <iterator> // see [iterator.synopsis] namespace std::ranges { […] template<class T> using iterator_t = decltype(ranges::begin(declval<T&>())); // freestanding template<range R> using sentinel_t = decltype(ranges::end(declval<R&>())); // freestanding template<range R> using const_iterator_t = const_iterator<iterator_t<R>>; // freestanding template<range R> using const_sentinel_t = const_sentinel<sentinel_t<R>>; // freestanding […] }
[ 2022-11-12 Approved at November 2022 meeting in Kona. Status changed: Voting → WP. ]
[ 2022-10-12; Reflector poll ]
Set status to "Tentatively Ready" after seven votes in favour.
[ 2022-09-25; Daniel and Hewill provide alternative wording ]
The alternative solution solely adds the suggested const_sentinel_t alias template and doesn't touch the const_iterator_t constraints.
[ 2022-09-23; Reflector poll ]
Set priority to 3 after reflector poll.
Comment from a reviewer:"I don't see why we should redundantly constrain const_iterator_t with input_range; it's not as if we can make it more ill-formed or more SFINAE-friendly than it is now."
Previous resolution [SUPERSEDED]:
This wording is relative to n4917.
Modify [ranges.syn], header <ranges> synopsis, as indicated:
#include <compare> // see [compare.syn] #include <initializer_list> // see [initializer.list.syn] #include <iterator> // see [iterator.synopsis] namespace std::ranges { […] template<class T> using iterator_t = decltype(ranges::begin(declval<T&>())); // freestanding template<range R> using sentinel_t = decltype(ranges::end(declval<R&>())); // freestanding template<input_range R> using const_iterator_t = const_iterator<iterator_t<R>>; // freestanding template<range R> using const_sentinel_t = const_sentinel<sentinel_t<R>>; // freestanding […] }
The type alias pair const_iterator and const_sentinel and the factory function pair make_const_iterator and make_const_sentinel are defined in <iterator>, however, only const_iterator_t exists in <ranges>, which lacks const_sentinel_t, we should add it to ensure consistency.
The proposed resolution also lifts the type constraint of const_iterator_t to input_range to make it consistent with const_iterator, which already requires that its template parameter must model input_iterator.History | |||
---|---|---|---|
Date | User | Action | Args |
2023-11-22 15:47:43 | admin | set | status: wp -> c++23 |
2022-11-17 00:42:33 | admin | set | messages: + msg13072 |
2022-11-17 00:42:33 | admin | set | status: voting -> wp |
2022-11-08 03:46:49 | admin | set | status: ready -> voting |
2022-10-12 14:38:10 | admin | set | messages: + msg12851 |
2022-10-12 14:38:10 | admin | set | status: new -> ready |
2022-09-25 06:26:12 | admin | set | messages: + msg12807 |
2022-09-23 15:44:07 | admin | set | messages: + msg12803 |
2022-09-08 08:31:01 | admin | set | messages: + msg12755 |
2022-09-05 00:00:00 | admin | create |