On this page
std::ranges::iterator_t, std::ranges::const_iterator_t, std::ranges::sentinel_t, std::ranges::const_sentinel_t, std::ranges::range_size_t, std::ranges::range_difference_t, std::ranges::range_value_t, std::ranges::range_reference_t
Defined in header <ranges> |
||
|---|---|---|
|
(1) | (since C++20) |
|
(2) | (since C++23) |
|
(3) | (since C++20) |
|
(4) | (since C++23) |
|
(5) | (since C++20) |
|
(6) | (since C++20) |
|
(7) | (since C++20) |
|
(8) | (since C++20) |
|
(9) | (since C++23) |
|
(10) | (since C++20) |
|
(11) | (since C++20) |
1) Used to obtain the iterator type of the type
T.
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.
6) Used to obtain the difference type of the iterator type of range type
R.
7) Used to obtain the value type of the iterator type of range type
R.
8) Used to obtain the reference type of the iterator type of range type
R.
9) Used to obtain the constant reference type of the iterator type of range type
R.
10) Used to obtain the rvalue reference type of the iterator type of range type
R.
11) Used to obtain the common reference type of the iterator type of 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 3860 | C++20 | range_common_reference_t was missing |
added |
| LWG 3946 | C++23 | const_iterator_t and const_sentinel_t were inconsistent with the result of ranges::cbegin and ranges::cend respectively |
tweaked |
See also
|
(C++20)(C++20)(C++23)(C++20)(C++20)(C++20)
|
computes the associated types of an iterator (alias template) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/ranges/iterator_t