title: Perfect forwarding function vs perfect forwarding constructor
body: <p>I can't figure out why this doesn't work:</p>
  
  <pre><code>template&lt;class T&gt; void makeNew(T&amp;&amp; func)
  {
      function&lt;void()&gt; p = forward&lt;T&gt;(func);  
  }
  
  class POP
  {
  private:
      function&lt;void()&gt; fu;
  public:
      template&lt;typename T&gt; POP(T&amp;&amp; func) : fu(forward&lt;T&gt;(func)) {}
  };
  
  void Test(){}
  </code></pre>
  
  <p>now to the code:</p>
  
  <pre><code>makeNew(Test); //compiles  (1)
  makeNew(&amp;Test); //compiles (2)
  makeNew(function&lt;void()&gt;(Test)); //compiles (3)
  POP pop(&amp;Test); //compiles (4)
  POP popp(Test); //doesn't compile (5)
  POP pp(function&lt;void()&gt;(Test)); //doesn't compile (6)
  </code></pre>
  
  <p>Why 1,3 compiles and 5,6 doesn't compile ?</p>
  
  <p>for (5) I get this error:</p>
  
  <p><code>error C2664: 'POP::POP&lt;void(void)&gt;(T (__cdecl &amp;&amp;))' : cannot convert parameter 1 from 'void (__cdecl *)(void)' to 'void (__cdecl &amp;&amp;)(void)'</code></p>
  
  <p>for (6) I get this error:</p>
  
  <p><code>'POP pp(std::tr1::function&lt;_Fty&gt;)': prototyped function not called (was a variable definition intended?)</code></p>
  
  <p>Using VS2010.</p>