Range-v3
Range algorithms, views, and actions for the Standard Library
ranges::accumulate_fn Struct Reference

Public Member Functions

template<typename I , typename S , typename T , typename Op = plus, typename P = identity>
auto operator() (I first, S last, T init, Op op=Op{}, P proj=P{}) const -> T requires sentinel_for< S, I > &&input_iterator< I > &&indirectly_binary_invocable_< Op, T *, projected< I, P >> &&assignable_from< T &, indirect_result_t< Op &, T *, projected< I, P >>>
 
template<typename Rng , typename T , typename Op = plus, typename P = identity>
auto operator() (Rng &&rng, T init, Op op=Op{}, P proj=P{}) const -> T requires input_range< Rng > &&indirectly_binary_invocable_< Op, T *, projected< iterator_t< Rng >, P >> &&assignable_from< T &, indirect_result_t< Op &, T *, projected< iterator_t< Rng >, P >>>