19 Sep
2009
19 Sep
'09
6:18 p.m.
So you say that the callback is really not required?
Hi Ramon, The STL for_each [1] accepts a "unary function object" [2] which offers more flexibility than a simple non-member function. For example (off the top of my head) [3]: Class myClass; for_each( begin, end, boost::bind( & Class::function, &myClass _1 )); I also point out that if you wanted to, you could replace for_each with your own for loop. (Not that you need to.) 1. http://www.sgi.com/tech/stl/for_each.html 2. http://www.sgi.com/tech/stl/functors.html 3. http://www.boost.org/doc/libs/1_40_0/libs/bind/bind.html#with_algorithms HTH, Kevin