Boost logo

Boost Users :

From: Mike Feldmeier (pooky_bunny_at_[hidden])
Date: 2004-06-02 12:53:31

Hi everyone,

Could someone please point me in the right direction with this one? :

class data
   int x;

class worker
   void run(&data d);

void run_worker(worker& w, data& d)
   boost::thread(boost::bind(&worker::run, &my_worker,

void main()
   worker my_worker;
   data my_data;

   run_worker(my_worker, my_data);

Compiling this yields..

test.cpp(24) : error C2440: 'type cast' : cannot convert from
'boost::_bi::bind_t<R,F,L>::result_type' to 'boost::thread'
            F=boost::_mfi::mf1<void,worker,data &>,
*,boost::arg<1>>::B1,boost::_bi::list_av_2<worker *,boost::arg<1>>::B2>
        Expressions of type void cannot be converted to other types

Can I not bind to functions with a void return type? Changing it to int,
produces a similar message.

Any help appreciated!


FREE pop-up blocking with the new MSN Toolbar get it now!

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at