If I manually overload the ==
operator for a structure, do I get the !=
operator for free (presumably defined to be the boolean opposite), or do I have to overload it manually (even if to just return !(this == rhs)
?
Edit-The question is not whether or not I CAN overload both operators, but whether I must overload inequality if I've already overloaded the equality operator. Regardless, good answers have been given.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…