Exemple #1
0
 /// <summary>
 /// Adds the specified <see cref="UnitValue{TValue,TUnit}"/> objects and returns the result.
 /// </summary>
 /// <typeparam name="TValue">The value type.</typeparam>
 /// <typeparam name="TUnit">The unit type.</typeparam>
 /// <param name="lhs">The left-hand operator.</param>
 /// <param name="rhs">The right-hand operator.</param>
 /// <returns>The resulting value, if the operation was successful; otherwise, <c>default</c>.</returns>
 public static UnitValue <TValue, TUnit> Add <TValue, TUnit>
 (
     this UnitValue <TValue, TUnit> lhs,
     UnitValue <TValue, TUnit> rhs
 )
     where TUnit : struct
     where TValue : struct, IEquatable <TValue> =>
 lhs.Binary(
     rhs,
     (left, right) => !(left.Value is float leftValue)