Why can I not do this?
boost::shared_ptr<QueuList> next;
void QueuList::SetNextPtr(QueuList* Next)
{
boost::mutex mtx;
boost::mutex::scoped_lock lock(mtx);
{// scope of lock
//if (next == NULL) // is this needed on a shared_ptr??
next = Next; // Why can I not assign a raw ptr to a shared_ptr????
}
}
How should I do it instead??
EDIT: Calling this method when the next variable is assigned properly, it still causes an error when the QueuList object is destroyed for some reason. I get a debug assertion. The destructor of the object does nothing in particular. It only crashes when I call this function:
QueuList li;
QueuList lis;
li.SetNextPtr(&lis);
When main goes out of scope, I get a debug assertion... Any ideas??