The only options available are std::ranges::for_each
and simple range-based for
loop. No counterparts for std::accumulate
, std::reduce
or std::inner_product
. std::ranges::reduce
would be enough, if it were present; inner product can be achieved combining reduce with zip. Falling back to iterator based algorithms is disappointing. Adapting reduce for personal codebase is not a big deal, but a std function is IMHO a lot more desirable. I am wondering if there is such function in std lib or on the 23 horizons.
Regards, FM.
std::accumulate()
andstd::reduce()
etc. with ranges. You just have to dor.begin(), r.end()
. – Contemporarybegin
&end
pair? The probability of using unrelated iterators for the pair is a source for bugs. – Azoic