59 struct RANGES_EMPTY_BASES adjacent_filter_view
60 : view_adaptor<adjacent_filter_view<Rng, Pred>, Rng,
62 ,
private box<semiregular_box_t<Pred>, adjacent_filter_view<Rng, Pred>>
68 struct adaptor : adaptor_base
71 friend struct adaptor<!Const>;
72 using CRng = meta::const_if_c<Const, Rng>;
73 using Parent = meta::const_if_c<Const, adjacent_filter_view>;
78 constexpr adaptor(Parent * rng) noexcept
82 requires Const && CPP_NOT(Other))
83 constexpr adaptor(adaptor<Other> that)
88 auto const last = ranges::end(rng_->base());
89 auto & pred = rng_->adjacent_filter_view::box::get();
90 RANGES_EXPECT(it != last);
91 for(
auto tmp = it; ++it != last; tmp = it)
92 if(invoke(pred, *tmp, *it))
100 auto const first = ranges::begin(rng_->base());
101 auto & pred = rng_->adjacent_filter_view::box::get();
102 RANGES_EXPECT(it != first);
107 if(invoke(pred, *--tmp, *it))
112 void distance_to() =
delete;
114 constexpr adaptor<false> begin_adaptor()
noexcept
119 constexpr auto begin_adaptor()
const noexcept
120 -> CPP_ret(adaptor<true>)(
121 requires detail::adjacent_filter_constraints<Rng const, Pred const>)
125 constexpr adaptor<false> end_adaptor()
noexcept
130 constexpr auto end_adaptor()
const noexcept
131 -> CPP_ret(adaptor<true>)(
132 requires detail::adjacent_filter_constraints<Rng const, Pred const>)
138 adjacent_filter_view() =
default;
139 constexpr adjacent_filter_view(Rng rng, Pred pred)
140 : adjacent_filter_view::view_adaptor{detail::move(rng)}
141 , adjacent_filter_view::box(detail::move(pred))
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