Hmm, this discussion group does not seem to support brackets, they didn't get posted. I'll re-write the question using parenthesis as brackets... ------------------------------------------------------------------------------------------ As we all know, forward declarations are necesary to implement circular references, like below: struct A; struct B { A * a; }; struct A { B * b }; My problem is, how do i deal with this using templates? The following pice of code is a syntax error in VC++ 6.0: template(class C) struct A; template(class C) struct B { A(C) * a; }; template(class C) struct A { B(C) * b }; Jonas
J
Jonas Petterssn
@Jonas Petterssn
Posts
-
Templates and forward declarations -
Templates and forward declarationsAs we all know, forward declarations are necesary to implement circular references, like below: struct A; struct B { A * a; }; struct A { B * b }; My problem is, how do i deal with this using templates? The following pice of code is a syntax error in VC++ 6.0: template struct A; template struct B { A * a; }; template struct A { B * b }; Does anyone know th correct syntax? :confused: Jonas Pettersson