-
Recent Posts
Recent Comments
Tags
Archives
Meta
Tag Archives: c#
Overloading == in C#
When overriding the == operator on immutable objects, I’ve previously done something akin to public static bool operator ==(MyThing x, MyThing y){ // Null tests try {var ignore = x.GetType(); } // Provoke NRE catch(NullReferenceException) { try { var ignore … Continue reading