|
Regarding the reasons for this compulsory requirement, academic theory analysis is more troublesome. Simply put, you have to ensure that your
The comparison operation cannot change the state of the two operands participating in the comparison, otherwise, the result of the comparison may be the same as the previous one.
The comparison results are inconsistent, which will cause sorting confusion-so regardless of the left operand * this, or the right operand,
All have to be modified with const. When modifying * this, it is actually the const behind the parameter list. |
|