【发布时间】:2012-02-04 06:53:59
【问题描述】:
Dictionary 的键是否需要与相等性进行比较?
例如
Class mytype
{
public bool equals(mytype other)
{
return ...;
}
}
在我的情况下,除非它们是同一个实例,否则它们不会相等。
如果我需要实现相等,我是否应该有一个随着 mytype 的每个新实例创建而递增的大数值?
【问题讨论】:
标签: c# collections dictionary set equality