No matching function call for template specialization of const char*
<p>I am trying to learn the template specialization for C++ language, coming across this situation I can't solve myself. Codes below:</p>

<pre><code>#include &lt;vector&gt;
#include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;cmath&gt;

using namespace std;
size_t count(const vector&lt;string&gt; &amp;, const char* const &amp;);

template &lt;typename T&gt;
size_t count(const vector&lt;T&gt;&amp; v, const T&amp; find) {
  size_t c = 0;
  for (auto ele : v) {
    if (ele == find)
      ++c;
  }
  return c;
}

template &lt;&gt;
size_t count(const vector&lt;double&gt; &amp;v, const double &amp;find) {
  size_t c = 0;
  for (auto ele : v) {
    if (abs(ele - find) &lt; 0.0001)
      ++c;
  }
  return c;
}

template &lt;&gt;
size_t count(const vector&lt;const char*&gt; &amp;v, const char* const &amp;find) {
  size_t c = 0;
  for (auto ele : v) {
    if (strcmp(ele, find) == 0)
      ++c;
  }
  return c;
}

size_t count(const vector&lt;string&gt; &amp;v, const char* const &amp;find) {
  size_t c = 0;
  for (auto ele : v) {
    if (strcmp(ele.c_str(), find) == 0)
      ++c;
  }
  return c;
}

int main() {
  vector&lt;double&gt; vd{0.1, 0.1, 0.2};
  cout &lt;&lt; count(vd, 0.1) &lt;&lt; endl;
  vector&lt;string&gt; vs{"I", "you", "I"};
  cout &lt;&lt; count(vs, "I") &lt;&lt; endl;
  vector&lt;const char*&gt; vc{"I", "you", "I"};
  cout &lt;&lt; count(vc, "I") &lt;&lt; endl;
  return 0;
}
</code></pre>

<p>Compiling this code, <code>cout &lt;&lt; count(vc, "I") &lt;&lt; endl;</code> will report error about not  finding a matching function call.</p>

<p>However, I deliberately declare a specialization for this function call, namely <code>template &lt;&gt; size_t count(const vector&lt;const char*&gt; &amp;v, const char* const &amp;find)</code></p>

<p>What is wrong here?</p>

<p>Thank you.</p>