Better handling of operations ?

This commit is contained in:
cdricms
2025-08-15 23:10:20 +02:00
parent d16cd5556a
commit 2dfdf5572f

View File

@@ -343,8 +343,8 @@ public struct UnitValue<ValueType: ConvertibleToDouble>:
} }
/// The result will have the `unit` of the left hand side value. /// The result will have the `unit` of the left hand side value.
public static func - <T: ConvertibleToDouble>( public static func - <L: ConvertibleToDouble, R: ConvertibleToDouble>(
lhs: UnitValue<T>, rhs: UnitValue<T> lhs: UnitValue<L>, rhs: UnitValue<R>
) )
-> UnitValue<Double> -> UnitValue<Double>
{ {
@@ -352,8 +352,8 @@ public struct UnitValue<ValueType: ConvertibleToDouble>:
} }
/// The result will have the `unit` of the left hand side value. /// The result will have the `unit` of the left hand side value.
public static func + <T: ConvertibleToDouble>( public static func + <L: ConvertibleToDouble, R: ConvertibleToDouble>(
lhs: UnitValue<T>, rhs: UnitValue<T> lhs: UnitValue<L>, rhs: UnitValue<R>
) )
-> UnitValue<Double> -> UnitValue<Double>
{ {
@@ -361,8 +361,8 @@ public struct UnitValue<ValueType: ConvertibleToDouble>:
} }
/// The result will have the `unit` of the left hand side value. /// The result will have the `unit` of the left hand side value.
public static func * <T: ConvertibleToDouble>( public static func * <L: ConvertibleToDouble, R: ConvertibleToDouble>(
lhs: UnitValue<T>, rhs: UnitValue<T> lhs: UnitValue<L>, rhs: UnitValue<R>
) )
-> UnitValue<Double> -> UnitValue<Double>
{ {
@@ -370,8 +370,8 @@ public struct UnitValue<ValueType: ConvertibleToDouble>:
} }
/// The result will have the `unit` of the left hand side value. /// The result will have the `unit` of the left hand side value.
public static func / <T: ConvertibleToDouble>( public static func / <L: ConvertibleToDouble, R: ConvertibleToDouble>(
lhs: UnitValue<T>, rhs: UnitValue<T> lhs: UnitValue<L>, rhs: UnitValue<R>
) )
-> UnitValue<Double> -> UnitValue<Double>
{ {