From: Lane Sent: Thursday, March 20, 2014 11:08 PM To: boost-users@lists.boost.org Reply To: boost-users@lists.boost.org Subject: [Boost-users] passing pointer as function arg using boost::bind |
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.