title: Shared pointer managed object in C++
body: <p>The question is about how the shared pointer handles the object in the following codes:</p>
  <pre><code>std::vector&lt;float&gt; vec(10); 
  float* p = &amp;vec[0]; 
  std::shared_ptr&lt;float&gt; p_shared(p); 
  </code></pre>
  <p>The question is that whether the shared pointer p_shared still responsible for managing the vec, i.e. delete / garbage collection of vec? Is there any possibility that the vec has been deleted before the p_shared deletes vec?</p>