13#ifndef RANGES_V3_VIEW_COUNTED_HPP
14#define RANGES_V3_VIEW_COUNTED_HPP
24#include <range/v3/utility/static_const.hpp>
28#include <range/v3/detail/prologue.hpp>
35 struct counted_view : view_interface<counted_view<I>, finite>
40 iter_difference_t<I> n_;
43 counted_view() =
default;
44 counted_view(I it, iter_difference_t<I> n)
48 RANGES_EXPECT(0 <= n_);
50 counted_iterator<I> begin()
const
52 return make_counted_iterator(it_, n_);
60 return static_cast<detail::iter_size_t<I>
>(n_);
65 RANGES_INLINE_VAR
constexpr bool enable_borrowed_range<counted_view<I>> =
true;
67#if RANGES_CXX_DEDUCTION_GUIDES >= RANGES_CXX_DEDUCTION_GUIDES_17
80 operator()(I it, iter_difference_t<I> n)
const
82 return {make_counted_iterator(std::move(it), n), default_sentinel};
86 subrange<I> operator()(I it, iter_difference_t<I> n)
const
98 return {std::move(it), n};
100 template(
typename I)(
102 subrange<I> operator()(I it, iter_difference_t<I> n)
const
123#include <range/v3/detail/epilogue.hpp>
124#include <range/v3/detail/satisfy_boost_range.hpp>
The random_access_iterator concept.
RANGES_INLINE_VARIABLE(detail::to_container_fn< detail::from_range< std::vector > >, to_vector) template< template< typename... > class ContT > auto to(RANGES_HIDDEN_DETAIL(detail
For initializing a container of the specified type with the elements of an Range.
Definition conversion.hpp:399
Definition adjacent_find.hpp:67
Definition range_fwd.hpp:152
Definition counted.hpp:36
Definition default_sentinel.hpp:26
Definition subrange.hpp:196
Definition counted.hpp:93
Definition counted.hpp:76