Modify a local instance of own class
<p>I've got a class where one of the private properties is an instance of the class. In Java (because I'm used to Java) this looks like:</p>

<pre><code>class Node {
    private Node Pi;
}
</code></pre>

<p>And now I'm writing this in C++, and when I try to do the same thing, I get a red underline (I'm using Visual C++ 2010 Express), "Incomplete type is not allowed".</p>

<pre><code>class Node {
    private:
        Node Pi; //Incomplete type is not allowed
};
</code></pre>

<p>I've tried fixing this by changing it to <code>Node Pi(void);</code> but then why I try to use another function that modifies this property I get "Expression must be a modifiable lvalue".</p>

<pre><code>class Node {
    private:
        Node Pi(void);
    public:
        void setPi(Node n);
};
void Node::setPi(Node n) {
    Pi = n; //Node Node::Pi() expression must be a modifiable lvalue
}
</code></pre>

<p>Normally in Java there's no problem with this, so my question is, how do I implement this? I'm not a beginner to C++, but I haven't written with it for a while.</p>

<pre><code>class Node {
    private Node Pi;
    void setPi(Node n) {
        this.Pi = n;
    }
}
</code></pre>
