boost::algorithm::for_each_n
// In header: <boost/algorithm/cxx17/for_each_n.hpp> template<typename InputIterator, typename Size, typename Function> InputIterator for_each_n(InputIterator first, Size n, Function f);
If f returns a result, the result is ignored.
Parameters:
f
A functor to apply to the elements of the sequence
first
The start of the first range.
n
One past the end of the first range.
Returns:
first + n