C++ FAQ Celebrating Twenty-One Years of the C++ FAQ!!!
(Click here for a personal note from Marshall Cline.)
Section 39:
[39.12] What special considerations are needed when forward declarations are used with member objects?

The order of class declarations is critical.

The compiler will give you a compile-time error if the first class contains an object (as opposed to a pointer to an object) of the second class. For example,

class Fred;  // Okay: forward declaration

class Barney {
  Fred x;  // Error: The declaration of Fred is incomplete
};

class Fred {
  Barney* y;
};
One way to solve this problem is to reverse order of the classes so the "used" class is defined before the class that uses it:
class Barney;  // Okay: forward declaration

class Fred {
  Barney* y;  // Okay: the first can point to an object of the second
};

class Barney {
  Fred x;  // Okay: the second can have an object of the first
};
Note that it is never legal for each class to fully contain an object of the other class since that would imply infinitely large objects. In other words, if an instance of Fred contains a Barney (as opposed to a Barney*), and a Barney contains a Fred (as opposed to a Fred*), the compiler will give you an error.