
AMDG Joost Kraaijeveld wrote:
What is wrong in my syntax in the std::for_each call (the BOOST_FOREACH works fine):
... class Session { virtual void stopSession(); }
class ServerSession : public Sessoon { }
typedef std::map
ServerSessions; ServerSessions serverSessions; ... ... typedef std::pair
ServerSessionsIterator; BOOST_FOREACH(ServerSessionsIterator session,serverSessions) { session.second->stopSession(); } std::for_each( serverSessions.begin(), serverSessions.end(), boost::lambda::bind( &ServerSession::stopSession, // function boost::bind(&ServerSessions::value_type::second, boost::lambda::_1))); // object
You need to use boost::bind or boost::lambda::bind consistently. In Christ, Steven Watanabe