title: Retrieve item from std::map in function marked const
body: <p>Consider the following C++ code:</p>
  
  <pre><code>// A.h
  class A {
  private:
      std::map&lt;int, int&gt; m;
      int getValue(int key) const;
  };
  
  // A.cpp
  int A::getValue(int key) const {
      // build error: 
      // No viable overloaded operator[] for type 'const std::map&lt;int, int&gt;'
      return m[key];
  }
  </code></pre>
  
  <p>How can I grab the value from <code>m</code> such that it works in the context of a <code>const</code> function?</p>