title: Printing a map of a vector of strings
body: <p>Trying to print a <code>map&lt;string, vector&lt;string&gt;&gt;</code>, but I keep getting the error:</p>
  
  <p><code>prob2.cc: In function âvoid printMap(const std::map&lt;std::basic_string&lt;char&gt;, std::vector&lt;std::basic_string&lt;char&gt; &gt; &gt;&amp;)â:
  prob2.cc:42:36: error: cannot bind âstd::basic_ostream&lt;char&gt;::__ostream_type {aka std::basic_ostream&lt;char&gt;}â lvalue to âstd::basic_ostream&lt;char&gt;&amp;&amp;â
  In file included from /opt/centos/devtoolset-1.1/root/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/iostream:40:0,
  </code></p>
  
  <p>I have no idea what it means, cannot bind ostream lvalue to ostream&amp;&amp; in file iostream.</p>
  
  <pre><code>void printMap(const map&lt;string, vector&lt;string&gt;&gt; &amp;mymap)
  {
  for(auto const&amp; i : mymap)
    cout &lt;&lt; i.first &lt;&lt; endl &lt;&lt; i.second &lt;&lt; endl;  //wanting to print out the vector of
  }                                              //strings belonging to each string key
  </code></pre>