title: Templated member function pointer as template parameter
body: <p>I am looking to accept a templated member function as a template parameter.</p>
  
  <p>For example, given this class:</p>
  
  <pre><code>class A
  {
  public:
      template&lt;typename... Args&gt;
      void Foo(Args...) {}
  
      void Bar() {}
  };
  </code></pre>
  
  <p>I would like to be able to call:</p>
  
  <pre><code>Invoke&lt;&amp;A::Foo&gt;(5, true);
  </code></pre>
  
  <p>And have this be similar to calling:</p>
  
  <pre><code>A a;
  a.Foo(5, true);
  </code></pre>
  
  <p>I know how to do this for <code>Bar()</code>:</p>
  
  <pre><code>template&lt;void (A::*F)()&gt;
  void Invoke()
  {
      A a;
      (a.*F)();
  }
  
  int main()
  {
      Invoke&lt;&amp;A::Bar&gt;();
  }
  </code></pre>
  
  <p>Is it possible to extend this to a templated member function pointer?  Or similarly, to write a forwarding function like this that can handle a function with any parameter types.  This doesn't work, but something similar to:</p>
  
  <pre><code>template&lt;typename... Args, void (A::*F)(Args...)&gt;
  void Invoke(Args... args)
  {
      A a;
      (a.*F)(args...);
  }
  </code></pre>
  
  <p>I can see why this might not be possible, but if that's true could you point to the standard for why?  I am also trying to learn more about the specifics of the standard.</p>