$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] Example program that fails to compile (boost::bind and boost::function called for collection)
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-01-27 16:22:32
AMDG
Archie14 wrote:
> 	delegate dosomething;
> 	Test(CLIENTS& val) :  m_clients(val) {}
> 	void run()
> 	{
> 		std::for_each(m_clients().begin(), m_clients().end(), 
> 			boost::bind(&CLIENTS::CLIENT::commandhandler, 
> boost::ref(dosomething), _1 ));
> 	}
> };
>   
The parameters to boost::bind are in the wrong order.
Try:
boost::bind(&CLIENTS::CLIENT::commandhandler,
  _1, boost::ref(dosomething)));
In Christ,
Steven Watanabe