Hello, this code:
template <class tB>
struct A{
typedef float atype;
typedef typename tB::btype typeB;
};
template <class tA>
struct B{
typedef float btype;
typedef typename tA::atype typeA;
};
struct MyB;
struct MyA: public A<MyB>{};
struct MyB: public B<MyA>{};
int main(int argc, char *argv[])
{
}
does not compile because "main.cpp:6: error: invalid use of incomplete type ‘struct MyB’".
Basically the compiler cannot solve the loop because definition of A depends on definition of B an viceversa. Is there a way to sort this out? thanks,