title: c++ template function specialization - wrong number of template arguments?
body: <p>Okay, so I'm just learning about templates. Anyways, I'm probably (most definitely) doing something wrong, but here's the problem:</p>
  
  <p>My first template function is declared like this:</p>
  
  <pre><code>template&lt;typename T&gt;
  std::ostream&amp; printFormatted(T const&amp; container, std::ostream&amp; os = std::cout) {
      //...
  }
  </code></pre>
  
  <p>Then I'm supposed to implement a specialized case for maps, so this is what I tried to do:</p>
  
  <pre><code>template&lt;&gt;
  std::ostream&amp; printFormatted&lt;std::map&lt;typename key, typename value&gt;&gt;(std::map&lt;typename key, typename value&gt; const&amp; container, std::ostream&amp; os = std::cout) {
      //...
  }
  </code></pre>
  
  <p>I might be making a mistake with my key/value variables, not sure, but regardless, when trying to compile I get the error message:</p>
  
  <pre><code>error: wrong number of template arguments (1, should be 4)
  error: provided for ‘template&lt;class _Key, class _Tp, class _Compare, class _Allocator&gt; class std::__debug::map’
  </code></pre>
  
  <p>Clearly there's something I don't understand about templates or maps? Someone please help?</p>