title: std::shared_ptr, std::weak_ptr and control block
body: <p>I've been reading about <code>std::make_shared</code> function lately. As far as I understand from <code>Effective Modern C++</code> book, the make function should be preferred unless:</p>
  
  <ol>
  <li>Custom memory management is in place.</li>
  <li>There are memory concerns such as <code>std::weak_ptr</code> may outlive its <code>std::shared_ptr</code>, dealing with large objects, custom deleter, etc.</li>
  </ol>
  
  <p>So, I understand <code>std::make_shared</code> allocates an object on the heap and its control block with just one call. Hence, the problem is <code>std::shared_ptr</code>'s object may not be deleted until control block has to be released. Correct me if I am wrong, but this is when the last <code>std::weak_ptr</code> is released. Thus, <code>std::make_shared</code> may not be suitable if there is an alive <code>std::weak_ptr</code> which points to it.</p>
  
  <p>But is this still a problem for most objects? Do we need to care when control block is released for non-large objects? Arguably, memory isn't that hard to get nowadays, so is this a concern for just large objects and low memory systems?</p>
  
  <p>The point of my concern is: if I design a class which uses <code>std::make_shared</code>, and <code>std::weak_ptr</code> is used in the future, I have to go back and replace the make function with a regular <code>std::shared_ptr&lt;Class&gt;(new Class())</code>.</p>