int main() {
B bb;
C cc;
struct t tt;
class B {};
struct s { struct t * pt; };
struct t { struct s * ps; };
return 0;
}
class C {};
I just changed the example given here .
Why do struct forward declarations work but not class forward declarations?
Does this have anything to do with namespaces - tag namespaceand typedef namespace? I know that structure definitions without typedefs go to the tag namespace.
Structures are just classes with all public members. Therefore, I expect them to behave the same.
source
share