title: C++ no implicit conversions when forwarding arguments deduced from function pointer
body: <p>I'm trying to produce a smart proxy function, so that arguments are forwarded as given.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>#include &lt;utility&gt;
  #include &lt;iostream&gt;
  
  void func(int foo) {
      std::cout&lt;&lt;foo&lt;&lt;"\n";
  }
  
  template&lt;typename... ARGS&gt;
  void proxy( void(*callback)(ARGS...), ARGS&amp;&amp;... args) {
      callback( std::forward&lt;ARGS&gt;(args)... );
  }
  
  int main() {
      proxy( func, 17 );
      int foo = 17;
      proxy( func, foo );
  }
  </code></pre>
  
  <p>I was hoping that by letting the template resolution figure out <code>func</code>'s arguments, I'll have proxy with the signature <code>void proxy( void(*)(int), int );</code>. As such, it should accept both the first invocation (int is a rvalue) or second (int is a lvalue).</p>
  
  <p>In reality, the above program fails with:</p>
  
  <pre><code>so.cpp:16:5: error: no matching function for call to 'proxy'
      proxy( func, foo );
      ^~~~~
  so.cpp:9:6: note: candidate template ignored: deduced conflicting types for parameter 'ARGS' (&lt;int&gt; vs. &lt;int &amp;&gt;)
  void proxy( void(*callback)(ARGS...), ARGS&amp;&amp;... args) {
       ^
  1 error generated.
  </code></pre>
  
  <p>I.e. - failure to implicitly convert from <code>int &amp;</code> to <code>int</code>.</p>
  
  <p>Am I doing something wrong here?</p>