title: How to initialize a private static const map in C++?
body: <p>I need just dictionary or associative array <code>string</code> => <code>int</code>.</p>
  
  <p>There is type map C++ for this case.</p>
  
  <p>But I need only one map forall instances(-> static) and this map can't be changed(-> const);</p>
  
  <p>I have found this way with boost library</p>
  
  <pre><code> std::map&lt;int, char&gt; example = 
        boost::assign::map_list_of(1, 'a') (2, 'b') (3, 'c');
  </code></pre>
  
  <p>Is there other solution without this lib?
  I have tried something like this, but there are always some issues with map initialization.</p>
  
  <pre><code>class myClass{
  private:
      static map&lt;int,int&gt; create_map()
          {
            map&lt;int,int&gt; m;
            m[1] = 2;
            m[3] = 4;
            m[5] = 6;
            return m;
          }
      static map&lt;int,int&gt; myMap =  create_map();
  
  };
  </code></pre>