Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::bind with template
From: Philipp Kraus (philipp.kraus_at_[hidden])
Date: 2010-08-15 16:49:10


On 2010-08-15 10:39:35 +0200, Kraus Philipp said:

> Hi,
>
> I would like to create a thread group for my "worker objects" like: 
>
> std::vector< worker<T,D> > l_worker;
> boost::thread_group l_threads;
> for(std::size_t i=0; i < p_threads; ++i) {
> l_worker.push_back(  worker<T,D>(p_iteration, p_stepsize,
> m_derivation, m_optimize, m_static, p_batch)  );
>         l_threads.create_thread(  boost::bind( &worker<T,D>::optimize
> ), l_worker[i]  ); (*)
> }

Okay ich hatte die Klammer and die falsche Stelle gesetzt. Schande über
mich, ich habe den ganzen Tag diesen Fehler nicht gesehen
=> boost::bind( &worker<T,D>::optimize, l_worker[i] )



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net