I did a unit test in eclipse g ++ using google test. I had an error when I tried to perform a unit test self-binding check in a class that I developed.
as usual, the overload is pretty standard and looks like this:
CLASS operator=(const CLASS& rhs);
and when I tried to get this in the test:
CLASS A;
A = A; //compile error here, saying self assignment to itself. have no clue why, though.
I wonder if there is a specific method for a self-study test. Thank.
FYI, below is a snapshot of the error

user3360398
source
share