R
Rolf Magnus
Adam said:Hi All,
I have this stange compiler error. I have a class B that includes
pointers to class A, therefore I have done forward referencing by doing
class A; at the start of the header file.
Ok well that works ok, but if I include the following
class B {
A* p1 ;
A* p2 ;
B(A* a1, A* a2) {p1 = a1 ; p2 = a2 ;}
bool operator==(const C2Clique& p) const { return
(a1->getId()==p.a1->getId
}
Ok then I get an error messaging saying me that type A is undefined. I
have realised this is because I am using the ->getId() method of A in
the == in B.
So my question is that as A relies on B and vice versa how can I get
around this problem?
Put the implementation of the operator== into the .cpp file.