Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

Function template for_each_n

boost::algorithm::for_each_n

Synopsis

// 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);

Description

[Note] Note

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


PrevUpHomeNext