title: Losing qualifiers during template argument deduction
body: <p>Since I am using C++11, I have written my own <code>make_unique</code> function which takes a variadic template parameter pack and forwards it to the <code>std::unique_ptr</code> constructor. This works fine for simple data types. However, the objects I am trying to construct accept other type objects by const reference. On passing const references however, I am getting "Conversions loses qualifiers" i.e.</p>
  
  <pre><code>struct A {};
  struct B { B(const A&amp; ob) { ... } };
  
  A ob;
  auto ptr = make_unique&lt;B&gt;(ob); // error here
  
  // Definition of make_unique below:
  
  template &lt;typename T, typename... Args&gt;
  std::unique_ptr&lt;T&gt; make_unique(Args&amp;&amp;... args)
  { 
      return std::unique_ptr&lt;T&gt;{ new T{std::forward&lt;Args&gt;(args)...} } ;
  }
  </code></pre>
  
  <p>The error I am facing is </p>
  
  <pre><code>Conversions loses qualifiers, cannot convert argument 1 from 'const A' to 'A &amp;'.
  </code></pre>
  
  <p>How do I resolve the error? From what I can understand, the template type deduction is not what I am expecting it to be. </p>
  
  <p>Compiler: MSVC 2015, Update 3</p>