3#ifndef TETL_NUMERIC_ACCUMULATE_HPP
4#define TETL_NUMERIC_ACCUMULATE_HPP
6#include <etl/_utility/move.hpp>
13template <
typename InputIt,
typename Type>
14[[nodiscard]]
constexpr auto accumulate(InputIt first, InputIt last, Type init)
noexcept -> Type
16 for (; first != last; ++first) {
17 init =
etl::move(init) + *first;
25template <
typename InputIt,
typename Type,
typename BinaryOperation>
26[[nodiscard]]
constexpr auto accumulate(InputIt first, InputIt last, Type init, BinaryOperation op)
noexcept -> Type
28 for (; first != last; ++first) {
29 init = op(
etl::move(init), *first);
constexpr auto accumulate(InputIt first, InputIt last, Type init, BinaryOperation op) noexcept -> Type
Computes the sum of the given value init and the elements in the range [first, last).
Definition accumulate.hpp:26
constexpr auto accumulate(InputIt first, InputIt last, Type init) noexcept -> Type
Computes the sum of the given value init and the elements in the range [first, last).
Definition accumulate.hpp:14
Definition adjacent_find.hpp:9