似乎总和不定义的IEnumerable< UINT>
(和其他无符号整数,对于这个问题)
It seems that Sum is not defined for IEnumerable<uint>
(and other unsigned integers, for that matter)
var s = new int[] { 1, 2, 3 };
s.Sum(); //works fine
var us = new uint[] { 1, 2, 3 };
us.Sum(); //missing method
我想知道:
在我做了一些根本性的错误/误解的情况? 在什么样的设计决策,可能会导致遗漏的IEnumerable&LT的; UINT&GT; .SUM()
MSDN:Enumerable.Sum
只是一个猜测:因为UINT是不符合CLS。不知道这会权衡他们决定不支持它。
Just a guess: Because uint is not CLS-compliant. Not sure if that would weigh in their decision to not support it.