title: smart pointers + "this" considered harmful?
body: <p>In a C++ project that uses smart pointers, such as <code>boost::shared_ptr</code>, what is a good design philosophy regarding use of "<strong><code>this</code></strong>"?</p>
  
  <p>Consider that:</p>
  
  <ul>
  <li><p>It's dangerous to store the raw pointer contained in any smart pointer for later use.  You've given up control of object deletion and trust the smart pointer to do it at the right time.</p></li>
  <li><p>Non-static class members intrinsically use a <strong><code>this</code></strong> pointer.  It's a raw pointer and that can't be changed.</p></li>
  </ul>
  
  <p>If I ever store <code>this</code> in another variable or pass it to another function which could potentially store it for later or bind it in a callback, I'm creating bugs that are introduced when anyone decides to make a shared pointer to my class.</p>
  
  <p><strong>Given that, when is it ever appropriate for me to explicitly use a <code>this</code> pointer?</strong>  Are there design paradigms that can prevent bugs related to this?</p>