Hi,
I would like to create a thread group for my "worker objects" like:
std::vector< worker > l_worker;
boost::thread_group l_threads;
for(std::size_t i=0; i < p_threads; ++i) {
l_worker.push_back( worker(p_iteration, p_stepsize,
m_derivation, m_optimize, m_static, p_batch) );
l_threads.create_thread( boost::bind( &worker::optimize ),
l_worker[i] ); (*)
}
I get a compiler error at (*) on boost/bind/bind.hpp:
In instantiation of
'boost::_bi::result_traits::*)()>':
error: 'void (worker::*)()' is not a class, struct, or
union type
boost/bind/bind_template.hpp:15: instantiated from
'boost::_bi::bind_t::*)(), boost::_bi::list0>'
The variables T is a typename and D is std::size_t > 0
How can I bind my template object () to the create_thread
methode?
Thanks
Phil