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