title: shared_ptr as class member
body: <p>It's common to declared contained objects as a pointers to that class, while "forward declarating" them in header file. This in order to reduce physical dependencies in code.</p>
  
  <p>For example</p>
  
  <pre><code>class B;  // forward declaration   
  
  class A {
     private:
        B* pB;
  };
  </code></pre>
  
  <p>Would it be good idea to declare such a member as shared_ptr, instead of naked pointer?</p>
  
  <p>I would prefer scoped_ptr, but AFAIK it it won't be in standard.</p>