title: How to iterate over a C++ STL map data structure using the 'auto' keyword?
body: <p>So far I have always used an iterator for traversing through all the keys in an STL map as follows:</p>
  
  <pre><code>    for (std::map&lt;char,int&gt;::iterator it=mymap.begin(); it!=mymap.end(); ++it){
              std::cout &lt;&lt; it-&gt;first &lt;&lt; "  =&gt; " &lt;&lt; it-&gt;second &lt;&lt; '\n';
      }
  </code></pre>
  
  <p>Very recently though I came across some code that used a different style to iterate through the keys as shown below. Has this feature been added only recently in revised standard? It seems like a rather interesting way of getting more done with lesser code, as many other languages already provide. </p>
  
  <pre><code>    for (auto&amp; x: mymap) {
              std::cout &lt;&lt; x.first &lt;&lt; " =&gt; " &lt;&lt; x.second &lt;&lt; '\n';
      }  
  </code></pre>
  
  <p>Also, I am curious to know the exact implications of using the keyword "auto" here. </p>