title: Template function to check if a smart pointer is null
body: <p>To frame the question, I had a macro that took a parameter, and called methods on it using <code>-&gt;</code>.</p>
  
  <p>I wanted to extend it to check for null, but found that people were already using it with smart pointers, some of which don't support conversion to bool.</p>
  
  <p>Some of these smart pointers have differently named methods for null-checking, and I don't have access to all the code that uses this, so I need a generic solution.</p>
  
  <p>I was thinking having the macro forward to some template function, but I'm not sure how to do it completely generically.</p>