61 struct common_view : view_interface<common_view<Rng>, range_cardinality<Rng>::value>
68 sentinel_t<Rng> end_(std::false_type)
70 return ranges::end(rng_);
74 return ranges::begin(rng_) + ranges::distance(rng_);
76 template(
bool Const =
true)(
77 requires Const AND
range<meta::const_if_c<Const, Rng>>)
78 sentinel_t<meta::const_if_c<Const, Rng>> end_(std::false_type)
const
80 return ranges::end(rng_);
82 template(
bool Const =
true)(
83 requires Const AND
range<meta::const_if_c<Const, Rng>>)
86 return ranges::begin(rng_) + ranges::distance(rng_);
90 common_view() =
default;
91 explicit common_view(Rng rng)
92 : rng_(detail::move(rng))
99 detail::common_view_iterator_t<Rng> begin()
101 return detail::common_view_iterator_t<Rng>{ranges::begin(rng_)};
103 detail::common_view_iterator_t<Rng> end()
105 return detail::common_view_iterator_t<Rng>{
106 end_(
meta::bool_<detail::random_access_and_sized_range<Rng>>{})};
109 auto CPP_fun(size)()(
112 return ranges::size(rng_);
115 template(
bool Const =
true)(
116 requires range<meta::const_if_c<Const, Rng>>)
118 -> detail::common_view_iterator_t<meta::const_if_c<Const, Rng>>
120 return detail::common_view_iterator_t<meta::const_if_c<Const, Rng>>{
121 ranges::begin(rng_)};
123 template(
bool Const =
true)(
124 requires range<meta::const_if_c<Const, Rng>>)
126 -> detail::common_view_iterator_t<meta::const_if_c<Const, Rng>>
128 return detail::common_view_iterator_t<meta::const_if_c<Const, Rng>>{
129 end_(
meta::bool_<detail::random_access_and_sized_range<
130 meta::const_if_c<Const, Rng>>>{})};
133 auto CPP_fun(size)()(
const
136 return ranges::size(rng_);
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