Avoiding circular class dependencies when definitions are required
<pre><code>template &lt;class T=A&gt;
struct B {
   T a;
};

struct A {
    B&lt;A&gt; foo(){
       B&lt;A&gt; result;
       return result;
    }
};
</code></pre>

<p>How can I avoid having to use a template (mind the default parameter to see its usage).
The problem is that both classes require each other's definitions. But there's no "real" circular dependence as the template solution shows.</p>
