Was it strange that the default context for uint and ulong was not checked, not checked, given that they are intended to represent values ββthat can never be negative?
So, if some code tries to violate this restriction, it seems to me that the exception would be the natural and preferred behavior instead of returning the maximum value (which can easily leave important parts of the data in an invalid state and impossible to return ..).
Is there an existing attribute that can be applied to any class / assembly so that it always performs arithmetic operations in a verified context? I thought to write it myself (as an aspect using PostSharp), but it would be great if it already were.
Many thanks,
source
share