title: How do I initialize a map with initializer list
body: <p>I'm stuck with a map initialization problem.
  I want a table to access all the directions of my tetris blocks.
  I have tried a lot of methods to initialize it, but it seems too complex to be initialized.</p>
  
  <p>This is the error info this time:</p>
  
  <p><i></p>
  
  <p>错误  C2440   “初始化”: 无法从“initializer list”转换为“std::map,std::allocator&lt;_Ty>>,std::allocator>>>,std::less&lt;_Kty>,std::allocator>,std::allocator>>>>>>” WinApp  c:\codes\learning\winapp\tetris.cpp 44<br>
  </i></p>
  
  <p>I wonder how to initialize this table.</p>
  
  <p>in my 
      <code>block</code>
  class:</p>
  
  <pre><code>typedef std::map&lt;shapes, std::vector &lt; std::vector&lt;std::pair&lt;int, int&gt; &gt; &gt; &gt; proj;
  static proj dirs ;
  </code></pre>
  
  <p>in the .cpp file:</p>
  
  <pre><code>block::proj block::dirs = 
  
  {
  { 6,{ { TL, TC, MR },{ TC, ML, BL } } },
  { 4,{ { TR, TC, ML },{ TC, MR, BR } } },
  { 5,{ { ML, MR, BC },{ TC, MR, BC },{ TC, ML, MR },{ TC, ML, BC } } },
  { 3,{ { TL, TC, ML } } },
  { 2,{ { { ML, BL, MR },{ TC, BC, BR },{ TR, ML, MR },{ TL, TC, BC } } } },
  { 1,{ { ML, BR, MR },{ TR, TC, BC },{ TR, TC, BC },{ TL, MR, ML },{ TC, BC, BL } } },
  { 0,{ { ML, MR,{ 2,0 },{ TC, BC,{ 0,2 } } } } }  // sticks out
  };
  </code></pre>
  
  <p>I defined the pairs as const vars for short.</p>
  
  <pre><code>const   std::pair&lt;int, int&gt;    TL{ -1,-1 };      /* top left */
  const   std::pair&lt;int, int&gt;     TC{ 0,-1 };        /* top center */
  const   std::pair&lt;int, int&gt; TR{ 1,-1 };     /* top right */
  const   std::pair&lt;int, int&gt;  ML{ -1,0 };              /* middle left */
  const   std::pair&lt;int, int&gt;  MR{ 1,0 };               /* middle right */
  const   std::pair&lt;int, int&gt;    BL{ -1,1 };       /* bottom left */
  const   std::pair&lt;int, int&gt;   BC{ 0,1 };         /* bottom center */
  const   std::pair&lt;int, int&gt;     BR{ 1,1 };       /* bottom right */
  </code></pre>