Boost logo

Boost :

From: Tim Laplaca (tlaplaca_at_[hidden])
Date: 2004-11-22 10:50:17

I am very new to boost, I apologize if this has been asked before. I
searched the mailing list archive but could not find an answer to my



I was successful creating threads with functions that are not members of
objects, but when I try to create threads with a pointer to an object
member I get compilation errors (MS Visual Studio .NET).




class objclass;

typedef void (objclass::*pmf)(); // ptr to member func

class objclass



            objclass() : thread_id (0) { p=&objclass::dowork; }

            inline setthreadid(int x) {thread_id = x;}

            inline setvaltwo(std::string str) {valtwo = str;}

            void dowork();

            pmf p; // pointer to dowork member function


            int getthreadid() {return thread_id;}

            std::string getvaltwo() {return valtwo;}



            int thread_id;

            std::string valtwo;




void objclass::dowork()





(In the main...)


boost::thread_group thrds;

objclass * objthread;


objthread = new objclass;

thrds.create_thread( (objthread->p) );


I get the following error:

error C2664: 'void
ion::function_ptr_tag)' : cannot convert parameter 2 from
'boost::detail::function::member_ptr_tag' to









Is there a way around this problem, or is it simply not possible to make
threads from object members with boost?








Boost list run by bdawes at, gregod at, cpdaniel at, john at