S
silverburgh.meryl
Hi,
I have a function which takes 2 references of A:
void f1 (const A& a1, const A& a2) {
if (a1 == a2)
return;
// do something else
}
My question is does this line 'a1 == a2' does an address check? or it
will calls the overloaded == operator of A?
For example, if I do this:
A* anA = new A();
f1 (*anA, *anA);
// will the overloaded == operator of A gets called? or it will not
get call since *anA points to the same address, "a1 == a2" is true.
Thank you.
I have a function which takes 2 references of A:
void f1 (const A& a1, const A& a2) {
if (a1 == a2)
return;
// do something else
}
My question is does this line 'a1 == a2' does an address check? or it
will calls the overloaded == operator of A?
For example, if I do this:
A* anA = new A();
f1 (*anA, *anA);
// will the overloaded == operator of A gets called? or it will not
get call since *anA points to the same address, "a1 == a2" is true.
Thank you.