I have a function foo(myclass* ob) and I am trying to create a consumer thread using consumer_thread(boost::bind(&foo)(&ob))
The code does not compile which I believe is due to my inappropriate way of passing the function argument to the function pointer.
class myclass{
// stuff
}
void foo(myclass* ob){
// stuff
}
int main(){
myclass* ob = new myclass();
boost::thread consumer_thread()boost::bind(&foo)(&ob));
// stuff
}
What am I doing wrong? Can anyone here elaborate on boost::bind and how to pass function pointers with function arguments?
Thanks in advance!