IEqualityComparer 相当于 (=) 运算符
是否公开了与相等 (=
) 运算符具有相同行为的 IEqualityComparer
? LanguagePrimitives 模块包含以下几个:FastGenericEqualityComparer
、GenericEqualityComparer
、GenericEqualityERComparer
。也许还有其他人?
Is an IEqualityComparer
exposed that has the same behavior as the equality (=
) operator? The LanguagePrimitives module contains a few: FastGenericEqualityComparer
, GenericEqualityComparer
, GenericEqualityERComparer
. Maybe there are others as well?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
深入研究 Reflector 后,它看起来像
FastGenericEqualityComparer
就是其中之一。它和 (=
) 运算符两者都调用HashCompare.GenericEqualityIntrinsic<'T>
。编辑
[`HashIdentity.Structural`](https://fsharp.github.io/fsharp-core-docs/reference/fsharp-collections-hashidentity.html#Structural) also forwards to `HashCompare.GenericEqualityIntrinsic`.
After digging through Reflector a bit more, it looks like
FastGenericEqualityComparer
is the one. It and the (=
) operator both callHashCompare.GenericEqualityIntrinsic<'T>
.EDIT
[`HashIdentity.Structural`](https://fsharp.github.io/fsharp-core-docs/reference/fsharp-collections-hashidentity.html#Structural) also forwards to `HashCompare.GenericEqualityIntrinsic`.