## 24.3 Functions, Generators, and Predicates

- Many algorithms require functions as arguments
- E.g., `for_each` takes 2 template arguments:
  1. The type of iterator
  2. The function type

  >     template<typename Iterator, typename Action>
  >     void for_each(Iterator current, Iterator stop,
  >           Action action)
  >     {
  >        while (current != stop)
  >        {
  >           action(*current);
  >           ++current;
  >        }
  >     }

prev |top |next