Function safe_add
Source pub fn safe_add<T: SafeAdd>(a: T, b: T) -> Result<T, SafeMathError>
Expand description
Performs safe addition with overflow checking.
Used internally by the #[safe_math] macro during expansion.
This function delegates to the appropriate trait method.
§Arguments
a - First operand.
b - Second operand.
§Returns
Ok(result) on success, Err(SafeMathError::Overflow) on error.