What's the recommended best practice for using IEqualityComparer?

前端 未结 6 1103
栀梦
栀梦 2020-12-30 09:33

I\'m looking for real world best practices, how other people might have implemented solutions with complex domains.

6条回答
  •  误落风尘
    2020-12-30 09:46

    I would say that the best use would be when you need to plug in different equality rules for a certain algorithm. Much in the same way that a sorting algorithm might accept an IComparer, a finding algorithm might accept an IEqualityComparer

提交回复
热议问题