std::ranges::iterator_t, std::ranges::const_iterator_t, std::ranges::sentinel_t, std::ranges::range_size_t, std::ranges::range_difference_t, std::ranges::range_value_t, std::ranges::range_reference_t, std::ranges::range_const_reference_t

From cppreference.com
< cpp‎ | ranges
 
 
Ranges library
Range access
Range conversions
(C++23)
Range primitives
range_size_trange_difference_t
range_value_t
range_reference_trange_const_reference_trange_rvalue_reference_t
  (C++23)
iterator_tconst_iterator_tsentinel_t
(C++23)



Dangling iterator handling
Range concepts
Views

Factories






Adaptors
Range adaptor objects
Range adaptor closure objects
Helper items
 
Defined in header <ranges>
template <class T>
using iterator_t = decltype(ranges::begin(std::declval<T&>()));
(1) (since C++20)
template <ranges::range R>
using const_iterator_t = std::const_iterator<ranges::iterator_t<R>>;
(2) (since C++23)
template <ranges::range R>
using sentinel_t = decltype(ranges::end(std::declval<R&>()));
(3) (since C++20)
template <ranges::sized_range R>
using range_size_t = decltype(ranges::size(std::declval<R&>()));
(4) (since C++20)
template <ranges::range R>
using range_difference_t = std::iter_difference_t<ranges::iterator_t<R>>;
(5) (since C++20)
template <ranges::range R>
using range_value_t = std::iter_value_t<ranges::iterator_t<R>>;
(6) (since C++20)
template <ranges::range R>
using range_reference_t = std::iter_reference_t<ranges::iterator_t<R>>;
(7) (since C++20)
template <ranges::range R>

using range_const_reference_t =

    std::iter_const_reference_t<ranges::iterator_t<R>>;
(8) (since C++23)
template <ranges::range R>

using range_rvalue_reference_t =

    std::iter_rvalue_reference_t<ranges::iterator_t<R>>;
(9) (since C++20)
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 size type of the sized_range type R.
5) Used to obtain the difference type of the iterator type of range type R.
6) Used to obtain the value type of the iterator type of range type R.
7) Used to obtain the reference type of the iterator type of range type R.
8) Used to obtain the const_reference type of the iterator type of range type R.
9) Used to obtain the rvalue_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.

See also

computes the associated types of an iterator
(alias template)