I’ve implemented a class that overloads the == and != operators.
This seems to work fine; however, I get the warning 'type' defines operator == or operator != but does not override Object.Equals(object o).
Okay, so I implemented Equals. But now I get the warning 'type' defines operator == or operator != but does not override Object.GetHashCode().
Does this end at some point? Or have I wandered into a never-ending trail of requirements just because I want to overload == and !=?
Yes, once you implement
GetHashCodeit will end. Eric Lippert has blogged about its importance. All I can do is suggest you to read and trust him 🙂