title: C++11: Replace all non-owning raw pointers with std::shared_ptr()?
body: <p>With the advent of <code>std::unique_ptr</code>, the blemished <code>std::auto_ptr</code> can finally be put to rest.  So for the last several days, I have been changing my code to use smart pointers and to eliminate all <code>delete</code> from my code.</p>
  
  <p>Although valgrind says my code is memory-clean, the semantic richness of smart pointers will make for cleaner and easier-to-understand code.</p>
  
  <p>In most of the code, the translation is simple: use <code>std::unique_ptr</code> for in place of the raw pointers held by the owning objects, throw out <code>delete</code>, and carefully sprinkle <code>get()</code>, <code>reset()</code> and <code>move()</code> calls, as needed, to interface well with the rest of the code.</p>
  
  <p>I am at the point where I am translating <strong>non-owning raw pointers</strong> to smart pointers now.</p>
  
  <p>Since I was careful with the lifetimes of my objects (I ensure my modules only depend in one direction), valgrind tells me that I don't have any uninitialized reads, dangling pointers, or leaks.  So, technically, I could just leave those <strong>non-owning raw pointers</strong> alone now.</p>
  
  <p>However, one option is to change those <strong>non-owning raw pointers</strong> to <code>std::shared_ptr</code> because I know they are acyclic.  Or, would it be better to leave them as raw pointers?</p>
  
  <p><em>I need some advice from veteran users of smart pointers as to what rules of thumb you use to decide whether to keep <strong>non-owning raw pointers</strong> as-is, or to translate them into <code>std::shared_ptr</code>,</em> keeping in mind that I constantly unit-test and valgrind my code.</p>
  
  <p>EDIT:  I might be misunderstanding the use of <code>std::shared_ptr</code> - can they be used in conjunction with <code>std::unique_ptr</code>, or is it the case that if I use <code>std::shared_ptr</code>, all handles should also be <code>std::shared_ptr</code>?</p>