title: Conversion of Function Pointer Non-Type Template Parameter to Type Template Parameters
body: <p>The following example code compiles under gcc and works as I would hope.  It allows me to instantiate an object with a function definition as a template parameter, but then the class is able to use the different types in the function as if they were passed individually as type template parameters.</p>
  
  <pre><code>template&lt;class FuncSignature&gt; class Obj;
  
  template&lt;class Type1, class Type2&gt; class Obj&lt;Type1 (Type2)&gt;
  {
  public:
    Type1 var1;
    Type2 var2;
  };
  
  int main(int argc, char **argv)
  {
    Obj&lt;char (int)&gt; A;
    A.var1 = 'a';
    A.var2 = 3;
  }
  </code></pre>
  
  <p>Even though it seems to work, I'm not sure what this code is doing.  Why does this code work and does it conform to the C++ standard?</p>