A defines a structure and B defines some presentation, read- and write functions to it. Therefore B uses some state (member) variables which shall not be member of A, so it needs to be an own class.
I could of course just do
...which would rather be the same, at least for my. Why not for the compiler?Code:class A { }; class B { A mA; // VS complains that A is undefined }
I would like to use the inner class because this way it's in the namespace defined by the outer class.