I came across this problem:
I have two classes (classA & classB). classA has an inner class: classC
Normally, to create a member of type inner class classC in classB I would do this:
ClassA::ClassC member_;
The definitions are in header files.
Now I need classB in classA so I include classB. h in classA.h
A variable of type classC needs to be passed with the constructor of classB.
I can't include classA.h in class be because I already included ClassB. in classA.h
The normal way (I think) to solve this problem (if I needed class A in classB.h is to say that classB is a class like this:
Code:
class classB
{
private:
class classA;
classA my_classA_;
...
}
But now I need classC in classB
and
class classA::classC;
doesn't work.
I solved the problem by taking classC out of classA but techicaly classC is part of classB so I'd rather put it in there.
Any ideas?