title: Specialize a void function template to a const char[N]
body: <p>I have a templated function which I want to specialize <code>foo</code> to <code>const char[N]</code> (hardcoded strings)</p>
  
  <pre><code>    template&lt;typename T&gt;
  const std::string foo() ;
  
      template&lt;typename T,int N&gt;
  const std::string foo&lt;T[N]&gt;() { return "T[N]"; } //this doesn't work for const char[12]
  
      template&lt;&gt;
  const std::string foo&lt;const char*&gt;() { return "Const char"; } //this doesn't work for const char[12]
  
     template&lt;typename T&gt;
     void someother function(T obj)
     {
  
     string s = foo&lt;T&gt;(); //I want to overload when T is const chat[N]
     }
  
     function("Hello World");  //When calling like this the type is const char[12]
  </code></pre>
  
  <p>I thought I can do something like was done <a href="http://www.dev102.com/2009/01/12/c-tip-how-to-get-array-length/" rel="nofollow"><strong>Here</strong></a>.<br>
  But it doesn't work as well, because I'm not passing a parameter, just a templated type.<br>
  I could do it like that, but there's just no reason to pass a parameter to that function.</p>
  
  <p>The example doesn't work because I'm not passing a variable. Tried a few things, but can't get it to work.  </p>
  
  <p>This is the only specialization I'm not able to solve. I've specialized the function for int,string and other types and they work OK.</p>
  
  <pre><code> error LNK2001: unresolved external symbol "class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; const __cdecl foo&lt;char const [12]&gt;(void)" 
  </code></pre>
  
  <p>The first templated declaration doesn't have any code in purpose... I'm trying to get the right specialization that will be used for my case.</p>