Array comprasion as Dictionary keys in C#

后端 未结 3 392
闹比i
闹比i 2021-01-20 01:42

I want to create class representing n-dimensional array, but where is a commutative access to its elements. e.g: a[new[] {4, 7, 55}] == a[new[] {55, 4, 7}]

3条回答
  •  -上瘾入骨i
    2021-01-20 01:50

    To me seems that GetHashCode have to be changed as it simply returns the hash code of Array object, considering the fact that you use NEW hashcode every time will be different, even if content equal.

提交回复
热议问题