System.Collections.IStructuralEquatable
and System.Collections.IStructuralComparable
were added in .NET 4, but why aren't they generic, like IEquatable<T>
and IComparable<T>
?
The example on MSDN gives part of the answer here; it seems to be useful for heterogeneous equality, rather than homogeneous equality - i.e. for testing whether two objects (/values) of potentially different types should be considered equal. In such scenarios, it is extremely likely that the calling code is dealing with object
(to represent heterogeneous data). And generic methods don't play nicely then.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With