Douglas Gregor
Boost.Bind can do that:
for_each(my_map.begin(), my_map.end(), bind(&Point::Reset, bind(&map
::value_type::second, _1))); So can Boost.Lambda:
for_each(my_map.begin(), my_map.end(), bind(&Point::Reset, (&_1)->*&map
::value_type::second));
Again, I can't see how this can work. "second" is the name of a member, not a function. You need a "pair select functor" to grab the first or second member from a pair. I've written a couple of these to use in conjunction with the projection_iterator adaptor. template <class P> struct select_pair_first : public std::unary_function
{ inline result_type& operator()(argument_type& arg) const { return arg.first; } inline const result_type& operator()(const argument_type& arg) const { return arg.first; } }; template <class P> struct select_pair_second : public std::unary_function
{ inline result_type& operator()(argument_type& arg) const { return arg.second; } inline const result_type& operator()(const argument_type& arg) const { return arg.second; } }; -- Steven E. Harris :: seharris@raytheon.com Raytheon :: http://www.raytheon.com