template<class InputIterator, class Distance>
constexpr void advance(InputIterator& i, Distance n);
template<class InputIterator>
constexpr typename iterator_traits<InputIterator>::difference_type
distance(InputIterator first, InputIterator last);
template<class InputIterator>
constexpr InputIterator next(InputIterator x,
typename iterator_traits<InputIterator>::difference_type n = 1);
template<class BidirectionalIterator>
constexpr BidirectionalIterator prev(BidirectionalIterator x,
typename iterator_traits<BidirectionalIterator>::difference_type n = 1);
void foo() { using namespace std::ranges; std::vector<int> vec{1,2,3}; distance(begin(vec), end(vec)); // #1 }
template<input_or_output_iterator I>
constexpr void ranges::advance(I& i, iter_difference_t<I> n);
template<input_or_output_iterator I, sentinel_for<I> S>
constexpr void ranges::advance(I& i, S bound);
template<input_or_output_iterator I, sentinel_for<I> S>
constexpr iter_difference_t<I> ranges::advance(I& i, iter_difference_t<I> n, S bound);
template<input_or_output_iterator I, sentinel_for<I> S>
constexpr iter_difference_t<I> ranges::distance(I first, S last);
return static_cast<range_difference_t<R>>(ranges::size(r)); // [range.prim.size]
return ranges::distance(ranges::begin(r), ranges::end(r)); // [range.access]