Necessity of writing print functions for containers?
<p>I use about 6 different C++ containers.  I started writing print functions to output the container contents.  Is this necessary?  I would think this is part of the C++ library?</p>

<pre><code>  void print_list(const list&lt;int&gt;&amp; list_int)
    {
    for (list&lt;int&gt;::const_iterator it = list_int.begin(); it != list_int.end(); it++) cout &lt;&lt; *it &lt;&lt; " ";
    }
  void print_um(const unordered_map&lt;int, double&gt;&amp; map_int_d)
    {
    for(unordered_map&lt;int, double&gt;::const_iterator it = map_int_d.begin(); it != map_int_d.end(); ++it)cout &lt;&lt; "[" &lt;&lt; it-&gt;first &lt;&lt; "," &lt;&lt; it-&gt;second &lt;&lt; "] ";
    }
</code></pre>
