27 Jan
2008
27 Jan
'08
12:59 a.m.
On 26/01/2008, Sohail Somani
Only thing you'd have to be careful of is copying of class C but you can inherit from boost::noncopyable to avoid any issues.
Using auto_ptr instead of shared_ptr would be another option, if you prefer ownership transfer semantics.
thread.reset(new thread(&C::ThreadJob));
Note also that a member function pointer is not usable on its own, so you'll need to do something like this instead: thread.reset(new thread( bind(&C::ThreadJob, this) ));