Forward declare typedef
<p><strong>Background</strong></p>

<p>I am working on creating a C++ binding to a Data Modeling Language. Part of this involves reading in a set of type definitions and translate it to C++ typdefs. At the moment, in my case there are around a 100 of these.</p>

<p><strong>Problem</strong></p>

<p>In the file I am reading the type definitions are not sorted in any way. So I might end up with defining a type to another type that hasn't been defined yet.</p>

<p>In C++ the problem basically is this:</p>

<pre><code>typedef typeA typeB;
typedef typeC typeA;
typedef double typeC;
</code></pre>

<p>So obviously this will not work, but can I forward declare these in any way?</p>

<p>A possible solution is of course for me to process these definitions before creating the C++ file: </p>

<pre><code>typedef double typeC;
typedef typeC typeA;
typedef typeA typeB;
</code></pre>

<p>But my questions is still, <strong>can I forward declare typdefs to make this work</strong>?</p>