Why no linq for byte, uint?

Enumerable.Sum() is only defined for IEnumerable where T in

double, double? int, int? decimal, decimal? long, long? float, float?

Is there a reason for not defining for byte, short or uint?

  • Is it to avoid overflow problems?
  • Or does it make type inference difficult for compiler? (Most Likely)

  • Because when you add a short and a short the outcome can be handled by an int. Could be some CLS compliant issues as well. This was posted as a similiar question:

    Why is there no Sum() extension for IEnumerable<uint>

    链接地址: http://www.djcxy.com/p/21114.html

    上一篇: C#CoClass属性有什么作用?

    下一篇: 为什么没有linq的字节,uint?