When forward declarations of functions work in a source file (.cpp), why would the same doesn\'t work for classes ?
Thanks.
// main.cpp
void forwar
The compiler reads stuff from beginning to end, and generates code as it goes. (Some compilers may not do this, but they should behave as if they did.) But before the class is defined, the compiler doesn't know that One::statVar
or One::anyAccess
should exist, or whether the function is virtual, static, or what. It needs to know that stuff in order to generate code.