std::ranges::iterator_t, std::ranges::const_iterator_t, std::ranges::sentinel_t, std::ranges::const_sentinel_t - cppreference.com
From cppreference.com
| Defined in header |
||
|
|
(1) | (since C++20) |
|
|
(2) | (since C++23) |
|
|
(3) | (since C++20) |
|
|
(4) | (since C++23) |
1) Used to obtain the iterator type of the type T.
2) Used to obtain the constant iterator type of the range type R.
3) Used to obtain the sentinel type of the range type R.
4) Used to obtain the constant sentinel type of the range type R.
Template parameters
| T | - | a type that can be used in std::ranges::begin |
| R | - | a range type or a sized_range type
|
Notes
iterator_t can be applied to non-range types, e.g. arrays with unknown bound.
Defect reports
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
| DR | Applied to | Behavior as published | Correct behavior |
|---|---|---|---|
| LWG 3946 | C++23 | const_iterator_t and const_sentinel_t were inconsistentwith the result of ranges::cbegin and ranges::cend respectively
|
tweaked |