class a;
class b;
class a {
b c;
};
class b {
};
Why doesn't this compile? I was under the impression that if you declared prototypes of classes, it didn't matter in which order they were declared. However, this doesn't work. In visual studio, it gives me:
error C2079: 'a::c' uses undefined class 'b'
In g++, it gives me:
error: field 'c' has incomplete type
What am I doing wrong?