title: Function argument template parameter ambiguous for const ref types
body: <p>I have a problem passing const ref parameters to template functions calling other functions. Consider the following code:</p>
  
  <pre><code>struct A
  {
      void foo(const int&amp; i) { }
  };
  
  template &lt;class ...Args&gt; 
  void a_caller(A&amp; a, void(A::*f)(Args...), Args&amp;&amp; ...args)
  {
      (a.*f)(std::forward&lt;Args&gt;(args)...);
  }
  
  int main()
  {
      int i = 42;
      A a;
  
      a_caller(a, &amp;A::foo, i); // (1) compiler error
      a_caller&lt;const int&amp;&gt;(a, &amp;A::foo, i); // (2) ok
  }
  </code></pre>
  
  <p>So, I have a member function <code>A::foo</code> with the <code>const int&amp;</code> argument which I want to call in the wrapper <code>a_caller</code>. The line (1) causes the following error:</p>
  
  <pre><code>'void a_caller(A &amp;,void (__thiscall A::* )(Args...),Args &amp;&amp;...)' : template parameter 'Args' is ambiguous
  see declaration of 'a_caller'
  could be 'const int&amp;'
  or       'int&amp;'
  </code></pre>
  
  <p>My first question is why this happens? I give the compiler a non-overloaded function A::foo, why can not it deduce <code>Args</code> from it?
  The second question is why this does not happen for std::make_unique then? The following code looks same to me, but the compiler has no problem deducing the constructor argument type:</p>
  
  <pre><code>struct A
  {
      A(const int&amp; i)  { }
  };
  
  int main()
  {
      int i = 42;
      auto aptr = std::make_unique&lt;A&gt;(i);
  }
  </code></pre>