title: How to take a pointer to a template function specialized on a string?
body: <p>I was trying use a set of filter functions to run the appropriate routine, based on a string input.  I tried to create matcher functions for common cases using templates, but I get a "type not equal to type" error when I try to store a pointer to the specialized function (in a structure, in the real application)</p>
  
  <p>Distilled example from a Visual C++ 8 'console application'</p>
  
  <pre><code>template &lt;const char *C&gt;
  const char*
  f(void) {
    return C;
  }
  
  const char* (*g)(void) = f&lt;"hi"&gt;;
  
  
  int _tmain(int argc, _TCHAR* argv[])
  {
    return g();
  }
  </code></pre>
  
  <p>This fails with the error</p>
  
  <pre><code>Error   1   error C2440: 'initializing' : cannot convert from 'const char *(__cdecl *)(void)' to 'const char *(__cdecl *)(void)'    c:\files\pointer.cpp    7   
  </code></pre>
  
  <p>(It also has an error on the main return value, but that doesn't concern me here.)</p>
  
  <p>The same example succedes if <code>const char *</code> is replaced with int.</p>