title: C++ stl list two structures cross-reference
body: <p>I have such code with 2 structures:</p>
  
  <pre><code>#include &lt;list&gt;
  
  using namespace std;
  
  struct Connection;
  struct User;    
  
  typedef list&lt;Connection&gt; Connections;
  typedef list&lt;User&gt; Users;
  
  struct User {
      Connections::iterator connection;
  };
  
  struct Connection {
      Users::iterator user;
  };
  </code></pre>
  
  <p>But when I try to compile it, the compiler (C++ Builder XE) return me such error - "<strong>Undefined structure 'Connection'</strong>".</p>
  
  <p>Can anyone help me with my problem?</p>
  
  <p>@ereOn,
      struct Connection;
      struct User;
      struct Connection {
          Users::iterator user;
      };
      typedef list Connections;
      typedef list Users;</p>
  
  <pre><code>struct User {
      Connections::iterator connection;
  };
  </code></pre>
  
  <p><strong>Undefined structure 'User'</strong></p>