Hello i have structures declared in the same Header file that need eachother.
struct A; // ignored by the compiler
struct B{
A _iNeedA; //Compiler error Here
};
struct A {
B _iNeedB;
};
this work normally
class A;
class B{
A _iNeedA;
};
class A {
B _iNeedB;
};
// everything is good
Thank you very much!
I answer my own question.
the fact is what im doing is not exactly what i posted but i thougt it was the same thing, actually i’m using operators that take arguments. Thoses operators body must be defined after my structs declarations (outside the struct),
because struct B don’t know yet struct A members…
I said it was working with classes because with classes we usualy use CPP file for methods definition, here i am not using any cpp file for methods i use in my structs
I was about to delete this post but you guys are too fast ;),
Here an example