title: Does STL Map auto-initialize values?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2346797/why-does-a-class-used-as-a-value-in-a-stl-map-need-a-default-constructor-in">Why does a class used as a value in a STL map need a default constructor in …?</a>  </p>
  </blockquote>
  
  
  
  <p>When I'm using a map, do values definitely get initialized to defaults or should I not rely on this?</p>
  
  <p>For example, say I have the following code:</p>
  
  <pre><code>map&lt;string, int&gt; myMap;
  cout &lt;&lt; myMap["Hey"];
  </code></pre>
  
  <p>This will output "0" with my compiler.  Is this guaranteed behavior?  Is it possible that this wouldn't always initialize to 0?</p>