title: Template specialization by Container::value_type
body: <p>I have the following two functions that I use to convert std containers to strings for logging purposes.</p>
  <pre><code>template &lt;typename TCollection, std::string(*ToStringFunc)(typename TCollection::value_type)&gt;
  std::string LOG_COLLECTION(const TCollection&amp; collection)
  {
     std::string as_str;
     for (const auto&amp; element : collection) 
     {
        as_str += ToStringFunc(element) + &quot; &quot;;
     }
     return as_str;
  }
  
  template &lt;typename TCollection&gt;
  std::string LOG_COLLECTION(const TCollection&amp; collection) 
  {
     return LOG_COLLECTION&lt;TCollection, std::to_string&gt;(collection);
  }
  </code></pre>
  <p>I want a specialization for containers of <code>std::string</code>s. Something like the following:</p>
  <pre><code>template &lt;typename TCollection&lt;std::string&gt;&gt;
  std::string LOG_COLLECTION(const TCollection&lt;std::string&gt;&amp; collection)
  {
     std::string as_str;
     for (const auto&amp; element : collection) 
     {
        as_str += ToStringFunc(element) + &quot; &quot;;
     }
     return as_str;
  }
  
  int main()
  {
     std::vector&lt;std::string&gt; vec{ &quot;a&quot;, &quot;b&quot;, &quot;c&quot; };
     std::string as_str = LOG_COLLECTION(vec)
  }
  </code></pre>
  <p>How do I do that (I am using <code>c++11</code>)? I tried to search the web but did not find a solution.</p>