title: how to return an null tr1::shared_ptr and test if it is null
body: <p>I have a function <code>getA()</code> with the following signature:</p>
  
  <pre><code>class A {  
  public:
   typedef std::tr1::shared_ptr &lt;A&gt; Ptr;
   //other member functions.... 
  };
  
  class B {
  public:
   A::Ptr getA();
  };
  </code></pre>
  
  <p>And, I want to return an empty pointer in <code>getA()</code> in same case; Also, as a user of <code>Class B</code> , I need to test if the return value of <code>getA()</code> is null before using it. How should I do it? </p>