title: How to properly create an array of member template function pointers via meta programming
body: <p>I want to pre create an array of template member function pointers, which will be indexed using a variable determined at run time by another class.  The template functions can then be specialized.  </p>
  
  <p>This works in a <code>non-template class</code>, however I'm having issues in a template class. The applications has multiple mains which define different template arguments for <code>MatchT</code>, and this is hopefully representative in the code example:</p>
  
  <pre><code>#include Data.H  // POD object.
  template&lt;typename MatchT&gt;
  class Manager
  { 
      public:
  
      template &lt;int P&gt;
      bool do(Data&amp; d_);
  
       template&lt;int P, int ...Ps&gt;
       struct table : table&lt;P-1, P-1, Ps... &gt;{};
  
       template&lt;int... Ps&gt;
       struct table &lt;0, Ps...&gt;
       {
            static constexpr bool(*fns[])(Data&amp;)={do&lt;Ps&gt;...};
       };
    };
  
     template &lt;typename MatchT&gt;
     template&lt;int... Ps&gt;
     constexpr bool(*Manager&lt;MatchT&gt;::table&lt;0,Ps...&gt;::fns[sizeof...(Ps)])();
  
  
  //process.h
  
   #include "Manager.H"
  
  template&lt;typename MatchT&gt;
  class Process
  {
     public:
  
     void send(Manager&lt;MatchT&gt;&amp; mgr  );
  
     private:
  
      typename Manager&lt;MatchT&gt;::template table&lt;4&gt; _processtable;
  };
  
   //process.c
  
   template&lt;typename MatchT&gt;
   void Process&lt;MatchT&gt;::send(Manager&lt;MatchT&gt;&amp; mgr)
   {
       ERROR here:
       mgr.*_processtable::fns[1]();
   }
  
  ERROR:
  In instantiation of "constexpr bool (* const Manager&lt;MyManager&lt;MyConfig&gt;   &gt;::table&lt;0,0,1,2,3&gt;::fns[4](Data&amp;) 
  
  required from "process.C"...
  required from "manager.H" error no  matches converting function 'do' to     type 'bool (* const)(struct Data&amp;)'
     static constexpr bool(*fns[])(Data&amp;) = {do&lt;Ps&gt;...};
  note:candidate  is: template&lt;int P&gt; bool Manager&lt;MatchT&gt;::do(Data&amp;) [with int P = P; MatchT = DummyMatch]
  
    required from "process.C"...
  required from "manager.H" error no  matches converting function 'do' to     type 'bool (* const)(struct Data&amp;)'
     static constexpr bool(*fns[])(Data&amp;) = {do&lt;Ps&gt;...};
  note:candidate  is: template&lt;int P&gt; bool Manager&lt;MatchT&gt;::do(Data&amp;) [with int P = P; MatchT = MyMatch&lt;MyConfig&gt; &gt;]
  </code></pre>
  
  <p>I'm wondering if having the static <code>static constexpr bool(*fns[])(Data&amp;)={do&lt;Ps&gt;...};</code> in the template class is causing an issue. Is it not able to define the functions as static for each <code>Manager&lt;MatchT&gt;</code> type?  What am I missing?</p>