Functions | |
| template<typename Result , typename Op > | |
| impl::foldl< Result, Op > | rangeless::fn::foldl (Result init, Op binary_op) |
Range-based version of c++20 (copy-free) std::accumulate More... | |
| template<typename Op > | |
| impl::foldl_d< Op > | rangeless::fn::foldl_d (Op binary_op) |
| Fold-Left-with-Default: this version uses default-initialized value for init. More... | |
| template<typename Op > | |
| impl::foldl_1< Op > | rangeless::fn::foldl_1 (Op binary_op) |
| Init-free version of foldl (first element is used as init); requires at least one element. More... | |
| impl::sliding_window | rangeless::fn::sliding_window (size_t win_size) |
| template<typename F > | |
| impl::for_each< F > | rangeless::fn::for_each (F fn) |
| template<typename F2 > | |
| impl::for_each_adjacent< F2 > | rangeless::fn::for_each_adjacent (F2 fn2) |
| impl::foldl<Result, Op> rangeless::fn::foldl | ( | Result | init, |
| Op | binary_op | ||
| ) |
Range-based version of c++20 (copy-free) std::accumulate
NB: The body of the fold-loop is init = binary_op(std::move(init), *it); If it is a move-ing iterator, like that of an seq, you'd take in by value or rvalue-reference in your binary operator, whereas if it's a regular iterator yielding lvalue-references, you'd take it by const or non-const reference.
| impl::foldl_1<Op> rangeless::fn::foldl_1 | ( | Op | binary_op | ) |
Init-free version of foldl (first element is used as init); requires at least one element.
| impl::foldl_d<Op> rangeless::fn::foldl_d | ( | Op | binary_op | ) |
Fold-Left-with-Default: this version uses default-initialized value for init.
| impl::for_each<F> rangeless::fn::for_each | ( | F | fn | ) |
| impl::for_each_adjacent<F2> rangeless::fn::for_each_adjacent | ( | F2 | fn2 | ) |
|
inline |
Return a seq yielding a view of a fixed-sized sliding window over elements.
If the input is a seq, last win_size elements are internally cached in a deque.