title: How to pass deleter to make_shared?
body: <p>Since C++11, because of several reasons, developers tend to use smart pointer classes for dynamic lifetime objects. And with those new smart pointer classes, standards, even suggest to not use operators like <code>new</code> instead they suggest to use <code>make_shared</code> or <code>make_unique</code> to avoid some error prone. </p>
  
  <p>If we like to use a smart pointer class, like <code>shared_ptr</code>, we can construct one like,</p>
  
  <pre><code>shared_ptr&lt;int&gt; p(new int(12));
  </code></pre>
  
  <p>Also we would like to pass a custom deleter to smart pointer classes,</p>
  
  <pre><code>shared_ptr&lt;int&gt; p(new int(12), deleter);
  </code></pre>
  
  <p>On the other hand, if we like to use <code>make_shared</code> to allocate, for ex. <code>int</code>, instead of use <code>new</code> and <code>shared_ptr</code> constructor, like on the first expression above, we can use</p>
  
  <pre><code>auto ip = make_shared&lt;int&gt;(12);
  </code></pre>
  
  <p>But what if we like to also pass a custom deleter to <code>make_shared</code>, is there a right way to do that? Seems like compilers, at least gcc, gives an error to,</p>
  
  <pre><code>auto ip = make_shared&lt;int&gt;(12, deleter);
  </code></pre>