Hi,I am study the Loki::SmartPtr,
I think the boost::enable_shared_from_this is very good implement,
we can get the smart pointer form a originality pointer of a class,
then we can use this function from the class's member function.
class CObj : public boost::enable_shared_from_this<CObj>
void Func(boost::shared_ptr<CObj> ptr)
boost::shared_ptr<CObj> ptr = shared_from_this();
boost::shared_ptr<CObj> ptr(new CObj);
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.