title: Why does shared_ptr use placement new
body: <p>I've read at many places that when using <code>make_shared&lt;T&gt;</code> to create a <code>shared_ptr&lt;T&gt;</code>, its control block contains a block of storage large enough to hold a <code>T</code>, and then the object is constructed inside the storage with placement new. Something like this:</p>
  
  <pre><code>template&lt;typename T&gt;
  struct shared_ptr_control_block {
      std::atomic&lt;long&gt; count;
      std::atomic&lt;long&gt; weak_count;
      std::aligned_storage_t&lt;sizeof (T), alignof (T)&gt; storage;
  };
  </code></pre>
  
  <p>But I'm a bit confused why we can't just have a member variable with type <code>T</code> instead? Why create the raw storage then use placement new? Can't it be combined in one step with a normal object of type <code>T</code>?</p>