title: Automatic template parameter deduction in unique_ptr and make_unique
body: <p>Why do I get automatic template parameter deduction if I call class constructor directly but I do not get it in <code>std::unique_ptr</code> and <code>std::make_unique</code>? Here is an example:</p>
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;memory&gt;
  template &lt;class T&gt;
  class C
  {
  public:
   C(const T * const t_) : t(t_) {}
   ~C(void) { delete t; }
  private:
   const T * const t;
  };
  </code></pre>
  <p>Example 1 (works):</p>
  <pre class="lang-cpp prettyprint-override"><code>int main(void)
  {
   const int * const t = new int;
   auto * const c = new C(t);
   return 0;
  }
  </code></pre>
  <p>Example 2 (does not compile):</p>
  <pre class="lang-cpp prettyprint-override"><code>int main(void)
  {
   const int * const t = new int;
   auto * const c = new C(t);
   std::unique_ptr p(c); // class template argument deduction failed
   return 0;
  }
  </code></pre>
  <p>Example 3 (works):</p>
  <pre class="lang-cpp prettyprint-override"><code>int main(void)
  {
   const int * const t = new int;
   const auto c = std::make_unique&lt;C&lt;int&gt;&gt;(t);
   return 0;
  }
  </code></pre>
  <p>Example 4 (does not compile):</p>
  <pre class="lang-cpp prettyprint-override"><code>int main(void)
  {
   const int * const t = new int;
  
   // no matching function for call to ‘make_unique&lt;template&lt;class T&gt; class C&gt;(const int* const&amp;)
   const auto c = std::make_unique&lt;C&gt;(t);
   return 0;
  }
  </code></pre>
  <p>The code was compiled with <code>g++ -std=c++17</code> (gcc-11.2.0).</p>
  <p>What is the problem in examples 2 and 4? How can one fix them?</p>
  <p>Thank you very much for your help!</p>