Just as the title state; imagine I have those two header files:
// a.h
class A {
A();
B operator+(A);
}
and
// b.h
class B {
B(A);
}
Is it somehow possible to make this work using includes/forward declares?
I've of course seen many related questions but they usually either have A
and B
contain instance of each other (which is obviously impossible) or can be fixed with pointers or references instead of object instances. However, I still want B
's constructor to actually use a A
instance, is that possible?