Usually in C++ when I need interdependencies between classes, I use forward declarations in the header files and then include both header files in each cpp file.
How
You can separate the declarations and definitions of classes. Therefore you can separate the declarations and definitions of template classes...
You can separate the declarations and definitions of class methods. Therefore you can separate the declarations and definitions of template class methods:
template struct B; // declaration
template struct A { // definition
void RunA(B *pB); // declaration
};
template struct B { // definition
void RunB(A *pA); // declaration
};
// definition
template
void A::RunA(B *pB) {
// need to do something to B here
}
// definition
template
void B::RunB(A *pA) {
// need to do something to A here
}