EqualityComparer<T>.Default isn't clever enough

不想你离开。 提交于 2019-12-04 05:01:13

I think that there's simply no compelling reason for the team responsible to add this feature. All features have an implementation cost which includes (among others) the time to document, code and test.

There are a couple of compelling reasons why this particular feature has not been picked over others so far (and will probably never make the cut IMO):

  • It only applies to a very narrow scenario (comparing enums backed by something other than an int, and doing that in some inner loop)
  • There is a very straightforward and discoverable solution if it causes you a problem (write your own comparer)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!