Range-v3 Range algorithms, views, and actions for the Standard Library |

Public Member Functions | List of all members
ranges::accumulate_fn Struct Reference
Numerics

## Public Member Functions
template<typename I , typename S , typename T , typename Op = plus, typename P = identity>
T | operator() (I first, S last, T init, Op op=Op{}, P proj=P{}) const
template<typename Rng , typename T , typename Op = plus, typename P = identity>
T | operator() (Rng &&rng, T init, Op op=Op{}, P proj=P{}) const

## Member Function Documentation

## ◆ operator()() [1/2]

template<typename I , typename S , typename T , typename Op = plus, typename P = identity>

T ranges::accumulate_fn::operator() | ( | I | first,
|  | S | last,
|  | T | init,
|  | Op | op = `Op{}`,
|  | P | proj = `P{}`
| ) |  | const

Precondition
  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>>>`

## ◆ operator()() [2/2]

template<typename Rng , typename T , typename Op = plus, typename P = identity>

T ranges::accumulate_fn::operator() | ( | Rng && | rng,
|  | T | init,
|  | Op | op = `Op{}`,
|  | P | proj = `P{}`
| ) |  | const

Precondition
  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>>>`