Why new while returning for overloaded operators for DBBool (TriState) implementation in C#
问题 If you look for the DBBool implementation in C#, few overloaded operators (logical operators | , & , ! ) new while returning. I believe that is not necessary and a small waste of memory. DBBool is a struct and a copy is made when it's passed into a method so there is no reason for that. // Logical negation operator. Returns True if the operand is False, Null // if the operand is Null, or False if the operand is True. public static DBBool operator !(DBBool x) { return new DBBool(-x.value); } /