title: How can I get a value from a map?
body: <p>I have a <code>map</code> named <code>valueMap</code> as follows:</p>
  
  <pre><code>typedef std::map&lt;std::string, std::string&gt;MAP;
  MAP valueMap;
  ...
  // Entering data.
  </code></pre>
  
  <p>Then I am passing this map to a function by reference:</p>
  
  <pre><code>void function(const MAP &amp;map)
  {
    std::string value = map["string"];
    // By doing so I am getting an error.
  }
  </code></pre>
  
  <p>How can I get the value from the map, which is passed as a reference to a function?</p>