K
kenkahn
I define a class "class xxx" with the following operator override:
class xxx {
int xxx:perator==(const xxx &ptr) const;
}
So if I define
xxx A;
xxx B;
I can do stuff like
if (A == B) {};
My question is what if instead I have
xxx *A_ptr = new xxx;
xxx *B_ptr = new xxx;
How do I define the operator override to work on object pointers
instead of by reference.
if (A_Ptr == B_ptr) {}
class xxx {
int xxx:perator==(const xxx &ptr) const;
}
So if I define
xxx A;
xxx B;
I can do stuff like
if (A == B) {};
My question is what if instead I have
xxx *A_ptr = new xxx;
xxx *B_ptr = new xxx;
How do I define the operator override to work on object pointers
instead of by reference.
if (A_Ptr == B_ptr) {}