title: std::map.operator[] not working with global maps
body: <p>Can someone tell me how I can make use of <code>std::map.operator[]</code> to get the value of a <code>const std::map</code> ?</p>
  <p>For example:</p>
  <p>file.h</p>
  <pre class="lang-cpp prettyprint-override"><code>#ifndef _FILE_H
  #define _FILE_H
  #include &lt;map&gt;
  #include &lt;string&gt;
  const std::map&lt;std::string,std::string&gt; STRINGS= {
      {&quot;COMPANY&quot;,&quot;MyCo&quot;}
      ,{&quot;YEAR&quot;,&quot;2022&quot;}
  };
  #endif
  </code></pre>
  <p>file.cpp</p>
  <pre class="lang-cpp prettyprint-override"><code>#include &quot;cpp_playground.h&quot;
  #include &lt;iostream&gt;
  int main (void){
      std::cout&lt;&lt; &quot;Code by &quot;&lt;&lt; STRINGS[&quot;COMPANY&quot;] &lt;&lt; &quot; &quot; &lt;&lt; STRINGS[&quot;YEAR&quot;] &lt;&lt; std::endl;
  }
  </code></pre>
  <p>With Visual Studio 2015 I get this error, but I can't interpret it</p>
  <pre><code>Severity    Code    Description Project File    Line    Suppression State
  Error   C2678   binary '[': no operator found which takes a left-hand operand of type 'const std::map&lt;std::string,std::string,std::less&lt;_Kty&gt;,std::allocator&lt;std::pair&lt;const _Kty,_Ty&gt;&gt;&gt;' (or there is no acceptable conversion)    cpp_playground  d:\user\documents\visual studio 2015\projects\cpp_playground\cpp_playground.cpp 10  
  </code></pre>