title: boost::ptr_container and std::vector<shared_ptr>
body: <p>After reading <a href="https://stackoverflow.com/questions/569775/smart-pointers-boost-explained/569872#569872">timdays answer</a> to <a href="https://stackoverflow.com/questions/569775/smart-pointers-boost-explained/">this question</a> I am curious about the difference between <code>boost::ptr_container</code> and a <code>std::vector&lt;shared_ptr&gt;</code>. I was under the impression that <a href="http://www.boost.org/doc/libs/1_45_0/libs/ptr_container/doc/ptr_container.html#motivation" rel="nofollow noreferrer">a <code>boost::ptr_container</code> had ownership over the pointers given to it</a>, and upon release would call the destructors of all the pointers it contained regardless of other references to its inhabitants. Which is contrary to the purpose of a <code>std::vector&lt;shared_ptr&gt;</code>, which after release would only release the pointers themselves if the ref count was 0?</p>
  
  <p>If this is the case (I assume it isn't), why would even the Boost documentation example <a href="http://www.boost.org/doc/libs/1_45_0/libs/ptr_container/test/simple_test.cpp" rel="nofollow noreferrer">compare the two</a> as though they are similar in purpose, and why would timday's answer propose a <code>boost::ptr_container</code> when it is very different to the purpose of a <code>std::vector&lt;shared_ptr&gt;</code>.</p>