| Home | Libraries | People | FAQ | More

## Function template for_each

boost::container::for_each

## Synopsis

    // In header: <boost/container/hub.hpp>

    template<typename ImplDefinedHubIterator, typename F>
      F for_each(ImplDefinedHubIterator first, ImplDefinedHubIterator last, F f);

## Description

Effects: Applies f to every element in [first, last), in order. Equivalent to: while(first != last) f(*first++); return f;

Requires: decltype(first) is the `iterator` or `const_iterator` of an instantiation of hub and [first, last) is a valid range.

Returns: std::move(f).

Note: Potentially faster than the equivalent loop thanks to internal unrolling and prefetching.