title: Two dimensional array of lists c++
body: <p>I have problem with two dimensional array of lists. I'm making list in structured then i'm connecting it with array.</p>
  
  <pre><code>class Game: parent, stan
  {
  public:
        static void Start();
  
  private:
      struct lista_rodzicow
      {
          static std::list&lt;parent&gt; kolejka;
      };
  
      static lista_rodzicow parent[10][10];
  </code></pre>
  
  <p>Here is my Parent.h header (not whole of course):</p>
  
  <pre><code>class parent
  {   
  public:
  int x, y, strona, combo;
  
      parent();
      parent(int x, int y, int s, int c):x(x), y(y), strona(s), combo(c)
      {
      }
  </code></pre>
  
  <p>And method I have problems with:</p>
  
  <pre><code>bool Game::CzyBylem(int x, int y)
  {
      for (std::list&lt;parent&gt;::iterator it = parent[x][y].kolejka.begin(); it != board[x][y].kolejka.end(); ++it)
      {
          if( it-&gt;x == x &amp;&amp; it-&gt;y == y )
              return true;
      }
  }
  </code></pre>
  
  <p>What I need is two dimension array with list (or queue) linked to it so eg. in element [3][4] I can add few different classes like (a, b, c, d).</p>
  
  <p>Completely example:</p>
  
  <pre><code>[0][0] - (a, b, c, d), (a2, b2, c2, d2)
  
  [0][1] - empty
  
  [1][0] - (a3, b3, c3, d3)
  
  [1][1] - (a4, b4, c4, d4), (a5, b5, c5, d5)
  </code></pre>
  
  <p>Erorrs i get: </p>
  
  <pre><code>Error   15  error C2923: 'std::list' : 'parent' is not a valid template type argument for parameter '_Ty'
  
  Error   16  error C2440: 'initializing' : cannot convert from 'std::_List_iterator&lt;_Mylist&gt;' to 'std::_List_iterator&lt;_Mylist&gt;'  
  
  Error   18  error C2228: left of '.end' must have class/struct/union    
  
  Error   19  error C2839: invalid return type 'int *' for overloaded 'operator -&gt;'   
  
  Error   20  error C2039: 'x' : is not a member of 'std::_List_iterator&lt;_Mylist&gt;'
  </code></pre>
  
  <p>Etc.</p>