Possible duplicate:
Forward the declaration of nested types / classes in C ++
For simple cross-reference of classes, it is possible to pre-stick class names and use them as a reference. So the view is a pointer. But in case I want to cross-reference the nested class of both (see Example below), I ran into difficulties, because there seems to be no way to pre-set the nested class.
So my question is: is there a way to predefine nested classes so that my example can work?
If not: is there a general workaround for this that doesn't code too ugly?
class Second;
class Second::Nested;
class First
{
public:
Second::Nested* sested;
class Nested { };
};
class Second
{
public:
First::Nested* fested;
class Nested { };
};
source
share