hpx::ranges::fold_right

hpx::ranges::fold_right#

Defined in header hpx/algorithm.hpp.

See Public API for a list of names and headers that are part of the public HPX API.

See also:

template<typename BidIter, typename Sent, typename T, typename F>
auto hpx::ranges::fold_right(BidIter first, Sent last, T init, F f)#

Right-folds a range of elements using a binary operator.

Note

Complexity: Exactly N applications of the binary operator.

Template Parameters:
  • BidIter – The type of the source begin iterator (deduced). This iterator must meet the requirements of a bidirectional iterator.

  • Sent – The type of the source sentinel (deduced).

  • T – The type of the initial value.

  • F – The type of the binary function object.

Parameters:
  • first – Refers to the beginning of the sequence.

  • last – Refers to the end of the sequence.

  • init – The initial value for the fold operation.

  • f – Binary function object that will be applied.

Returns:

The result of right-folding the range.

template<typename Rng, typename T, typename F>
auto hpx::ranges::fold_right(Rng &&rng, T init, F f)#

Right-folds a range of elements using a binary operator.

Template Parameters:
  • Rng – The type of the source range (deduced).

  • T – The type of the initial value.

  • F – The type of the binary function object.

Parameters:
  • rng – Refers to the sequence of elements.

  • init – The initial value for the fold operation.

  • f – Binary function object that will be applied.

Returns:

The result of right-folding the range.