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
struct A;
struct B {
int member;
bool operator<(const A& right); //body not defined
};
struct A {
int member;
bool operator<(const B& right)
{
return this->member < B.member;
}
};
bool B::operator<(const A& right) //define the body here after struct A definition
{
return this->member < A.member;
}