In C#, how can we check reference equality for a type that implements equality operator?
class C { public int Val{get;set;} public static bool operator =
If you mean equality by reference, you may use the Object.ReferenceEquals static method even if the == operator was overloaded for the current type to work otherwise:
Object.ReferenceEquals
==
Object.ReferenceEquals(obj1, obj2);