needs overload operator< and null check

后端 未结 5 1433
暖寄归人
暖寄归人 2020-12-18 21:54

I´m overloading the lessthan-operator in c# and I`m wondering whether this needs to check for null. Below you can find an Example:

public static bool operat         


        
5条回答
  •  臣服心动
    2020-12-18 22:17

    Personally I would throw a ArgumentNullException if either x or y are null, which should be an exceptional circumstance.

提交回复
热议问题