37 assignable_from<T &, invoke_result_t<Fun &, T, range_reference_t<Rng>>>
51 struct exclusive_scan_view : view_adaptor<exclusive_scan_view<Rng, T, Fun>, Rng>
57 semiregular_box_t<T> init_;
58 semiregular_box_t<Fun> fun_;
62 template<
bool IsConst>
63 struct adaptor : adaptor_base
66 friend struct adaptor<!IsConst>;
67 using exclusive_scan_view_t = meta::const_if_c<IsConst, exclusive_scan_view>;
68 using CRng = meta::const_if_c<IsConst, Rng>;
69 semiregular_box_t<T> sum_;
70 exclusive_scan_view_t * rng_;
73 auto CPP_auto_fun(move_or_copy_init)(std::false_type)
79 auto CPP_auto_fun(move_or_copy_init)(std::true_type)
81 return std::move(rng_->init_)
84 public :
using single_pass = exclusive_scan_view::single_pass;
86 adaptor(exclusive_scan_view_t * rng)
90 requires IsConst AND CPP_NOT(Other))
91 adaptor(adaptor<Other> that)
96 sum_ = move_or_copy_init(single_pass{});
97 return ranges::begin(rng_->base());
105 RANGES_EXPECT(it != ranges::end(rng_->base()));
106 sum_ = invoke(rng_->fun_,
static_cast<T &&
>(std::move(sum_)), *it);
109 void prev() =
delete;
112 adaptor<false> begin_adaptor()
121 auto begin_adaptor()
const
122 -> CPP_ret(adaptor<true>)(
128 auto end_adaptor()
const
129 -> CPP_ret(
meta::if_<use_sentinel_t, adaptor_base, adaptor<true>>)(
136 exclusive_scan_view() =
default;
137 constexpr exclusive_scan_view(Rng rng, T init, Fun fun)
138 : exclusive_scan_view::view_adaptor{std::move(rng)}
139 , init_(std::move(init))
140 , fun_(std::move(fun))
143 auto CPP_fun(size)()(
const
146 return ranges::size(this->base());
149 auto CPP_fun(size)()(
152 return ranges::size(this->base());
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