
16 Mar
2011
16 Mar
'11
1:52 p.m.
//File A.hpp class B; class A { double x; public: B inline convertToB(void); }; #include <A_detail.hpp> //File B.hpp class A; class B { double y; public: A inline convertToA(void); }; #include <B_detail.hpp> //File A_detail.hpp #include <B.hpp> B A::convertToB(void) { return B(x); } //File B_detail.hpp #include <A.hpp> A B::convertToA(void) { return A(y); } The compiler is giving the error that it can't access the private members. Once the forward declaration is used the compiler can't seem to use the full class later. Ryan