title: Will a default-constructed (empty) shared_ptr automatically be initialized to nullptr?
body: <p>I had read from some blog that a default-constructed (empty) <code>shared_ptr</code> is automatically initialized to <code>nullptr</code>. But could not find any such explicit statement in the statndards. </p>
  
  <p>I wrote a small snippet (Linux Compiled) to confirm this:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;memory&gt;
  
  struct Base;
  
  int main()
  {
      std::shared_ptr&lt;Base&gt; p;
      Base* b;
  
      if (p == nullptr) {
          std::cout &lt;&lt; "p IS NULL \n";
      }
      else {
          std::cout &lt;&lt; "p NOT NULL \n";
      }
  
      if (b == nullptr) {
          std::cout &lt;&lt; "b IS NULL \n";
      }
      else {
          std::cout &lt;&lt; "b NOT NULL \n";
      }
  
      return 0;
  }
  </code></pre>
  
  <blockquote>
    <p>Output:</p>
    
    <pre class="lang-none prettyprint-override"><code>p IS NULL 
  
  b NOT NULL
  </code></pre>
  </blockquote>
  
  <p>From this I see that the smart pointers are implicitly assigned <code>nullptr</code> at the time of Declaration. Can somebody confirm this behavior? Is it safe to use a <code>shared_ptr</code> without manually assigning a <code>nullptr</code> to it?</p>