IEqualityComparer等效于(=)运算符

时间:2011-08-10 20:26:02

标签: f# equality

是否公开了IEqualityComparer,其行为与相等(=)运算符相同? LanguagePrimitives模块包含一些:FastGenericEqualityComparerGenericEqualityComparerGenericEqualityERComparer。也许还有其他人?

1 个答案:

答案 0 :(得分:4)

经过反射器挖掘后,看起来FastGenericEqualityComparer就是那个。它和(=)运算符都调用HashCompare.GenericEqualityIntrinsic<'T>

修改

HashIdentity.Structural<'T>也转发给HashCompare.GenericEqualityIntrinsic<'T>