title: Boost Shared_Ptr assignment
body: <p>Why can I not do this?</p>
  
  <pre><code>boost::shared_ptr&lt;QueuList&gt; 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????
      }
  </code></pre>
  
  <p>}</p>
  
  <p>How should I do it instead??</p>
  
  <p>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:</p>
  
  <pre><code>    QueuList li;
      QueuList lis;
  
      li.SetNextPtr(&amp;lis);
  </code></pre>
  
  <p>When main goes out of scope, I get a debug assertion... Any ideas??</p>