| 52 | /// Similiar to std::accumulate but a projection can be applied to the elements first |
| 53 | template <class Iterator, class T, class BinaryOp, class UnaryOp> |
| 54 | T transform_accumulate(Iterator first, Iterator last, T init, BinaryOp binop, UnaryOp unaryop) |
| 55 | { |
| 56 | return std::inner_product( |
| 57 | first, last, first, std::move(init), binop, [&](auto&& x, auto&&) { return unaryop(x); }); |
| 58 | } |
| 59 | |
| 60 | /// Similiar to std::partial_sum but a projection can be applied to the elements first |
| 61 | template <class Iterator, class OutputIterator, class BinaryOperation, class UnaryOp> |
no test coverage detected