I’m having a problem passing a pointer as an arg via boost::bind and was hoping anyone could help out. I was able to pass ‘a’ just fine, but the second arg ’b’ I’m having a problem with.

Here is what I have.                


namespace NS {

class MyThread {

    int doIt(NS::A a, B *b);

// …


A a; 

B *b = new B();

NS::MyThread f_thread;

                    

boost::thread workerThread(boost::bind(&NS::MyThread::doIt, &f_thread,

    boost::ref(a), boost::ref(b)));


Any help much appreciated.