title: In C++, what is the correct way to do perfect forwarding an lvalue to a function template?
body: <p>What is the correct way to accept a parameter pack for perfect-forwarding, such that it will take any type and simply forward them? The following code works on regular types but fails on pointer types:</p>
  <pre><code>template&lt;typename ...A&gt;
  void b(A &amp;&amp;... args)
  {}
  
  template&lt;typename ...A&gt;
  void a(A &amp;&amp;... args)
  {
      b(std::forward&lt;A&gt;(args)...);
  }
  
  
  int main() {
  
      // ok
      a&lt;int&gt;(5);
  
      // error: cannot bind rvalue reference of type ‘int*&amp;&amp;’ to lvalue of type ‘int*’
      int *foo = nullptr;
      a&lt;int*&gt;(foo);
  
      return 0;
  }
  </code></pre>
  <p>[edit] Thanks for the quick and great replies! I oversimplified - this is a closer example of the problem I am trying to solve:</p>
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  template&lt;typename F&gt;
  struct fun;
  
  template&lt;typename F, typename ...A&gt;
  struct fun&lt;F(A...)&gt;
  {
      void b(A &amp;&amp;... args)
      {}
      
      void a(A &amp;&amp;... args)
      {
          b(std::forward&lt;A&gt;(args)...);
      }
  };
  
  int main() {
  
      // ok
      fun&lt;void(int)&gt; f1;
      f1.a(5);
  
      // error: cannot bind 'int' lvalue to 'int&amp;&amp;'
      fun&lt;void(int)&gt; f2;
      int x = 5;
      f2.a(x);
  
      return 0;
  }
  </code></pre>
  <p>In this case, I don't have the luxury to let the template adjust automatically... Any idea how this can be achieved?</p>
  <p>[edit 2] as pointed out in the comments, this has nothing to do with pointers, I updated my sample to simply use an <code>lvalue</code></p>