从这里: http: //www.boost.org/doc/libs/1_53_0/doc/html/boost_asio/example/chat/chat_server.cpp
std::set<chat_participant_ptr> participants_;
....
participants_.insert(participant);
....
void deliver(const chat_message& msg, chat_participant_ptr participant)
{
recent_msgs_.push_back(msg);
while (recent_msgs_.size() > max_recent_msgs)
recent_msgs_.pop_front();
// I want to call the deliver method on all members of set except the participant passed to this function, how to do this?
std::for_each(participants_.begin(), participants_.end(),
boost::bind(&chat_participant::deliver, _1, boost::ref(msg)));
}
我想在集合的所有成员上调用传递方法,除了参与者传递给这个函数,如何在 vs2008 中做到这一点?