A -> B, B -> A classes association
<p>This code doesn't do anything special. It's just a snippet to show the problem with forward declarations. Just a short question: why doesn't it work and how to force it to work?</p>

<pre><code>class A;

class B {
    A obj;
public:
    int getB() const {
        return 0;
    }
    void doSmth() {
        int a = obj.getA();
    }
};

class A {
    B obj;
public:
    int getA() const {
        return 1;
    }
    void doSomething() {
        int b = obj.getB();
    }
};
</code></pre>

<p>This code gives me errors:</p>

<pre><code>error C2079: 'B::obj' uses undefined class 'A'
error C2228: left of '.getA' must have class/struct/union
</code></pre>
