title: Ways to make it easier to work with shared pointers in C++
body: <p>I am busy designing a new C++ application.  In this application I want to minimize potential errors with pointers, and since the application should be plain C++ (no .Net or other fancy things), I am investigating shared pointers and I am considering using shared pointers everywhere (instead of normal pointers).</p>
  
  <p>I worked out some tricks to make it easier to work with shared pointers, e.g.: using a typedef within the class, like this:</p>
  
  <pre><code>class X
     {
     public:
        ...
        typedef std::shared_ptr&lt;X&gt; Ptr;
     };
  </code></pre>
  
  <p>That way you can easily write X::Ptr, which is easier to write than "std::shared_ptr" everywhere.</p>
  
  <p>I also noticed some disadvantages to shared pointers:</p>
  
  <ul>
  <li>Everywhere I use a shared pointer I need to include <code>&lt;memory&gt;</code></li>
  <li>I can't use forward declaration anymore if I just want to use the pointer</li>
  </ul>
  
  <p>Are there any other tricks to make shared pointers easier to work with?</p>