I am rewriting a originally java program in c++, and I am having problems with two particular classes whose definitions depend on each other. After encountering the problem, I googled it and found out about forward declaration. I tried using it, but it failed.
The problem is: both classes use members and function of the other class, not just a pointer, and therefore the forward declaration does not work. So the I keep getting "invalid use of incomplete type" errors, as well as a "forward declaration" error.
Any ideas on how to approach this?
p.s. I do realise this is probably not really well structured, and the relation between classes could be improved, but I would rather have it be as close as possible to the original implementation.