tfel
Loading...
Searching...
No Matches
tfel::fsalgo::for_each< N > Class Template Reference

For_each applies the function object f to each element in the range [first, first+N); f's return value, if any, is ignored. Applications are performed in forward order, i.e. from first to last. The function object is passed by reference: its state after the last application is available to the caller. More...

#include </home/runner/work/tfel/tfel/include/TFEL/FSAlgorithm/for_each.hxx>

Static Public Member Functions

template<typename InputIterator, typename UnaryFunction>
static void exe (InputIterator p, UnaryFunction &f)

Detailed Description

template<unsigned int N>
class tfel::fsalgo::for_each< N >

For_each applies the function object f to each element in the range [first, first+N); f's return value, if any, is ignored. Applications are performed in forward order, i.e. from first to last. The function object is passed by reference: its state after the last application is available to the caller.

Template Parameters
Nnumber of elements to which f will be applied

This documentation is mostly inspired from: http://www.sgi.com/tech/stl/for_each.html

See also
for_each.cxx for some elementary tests.
Author
Thomas Helfer
Date
30/06/2006

Member Function Documentation

◆ exe()

template<unsigned int N>
template<typename InputIterator, typename UnaryFunction>
void tfel::fsalgo::for_each< N >::exe ( InputIterator p,
UnaryFunction & f )
inlinestatic
Template Parameters
InputIteratorinput iterator
UnaryFunctionunary function which is applied to the elements
Parameters
[in]piterator to the first element
[in,out]ffunction applied to each element
Precondition
  • InputIterator is a model of Input Iterator
  • UnaryFunction is a model of Unary Function
  • UnaryFunction does not apply any non-constant operation through its argument.
  • InputIterator's value type is convertible to UnaryFunction's argument type.
Author
Thomas Helfer
Date
30/06/2006

The documentation for this class was generated from the following file: