codedhands 0 Light Poster

Hi,i am having problems passing arguments to a boost thread.I have tried using the boost::bind,it works without argument but when i try to pass arguments,it doesn't work.Here are my codes:

class Parser
{
void Start(int a)
{
...
}

void makeThread(int id)
{
boost::thread pThread(boost::bind(&Parser::Start,id));  //Problem here
boost::thread::yield();
pThread.join();
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.