1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 03:28:20 +02:00

Removed '=' in generic constraints

This commit is contained in:
Brian Fiete 2021-01-15 14:59:02 -08:00
parent 4890303508
commit a681da30be
6 changed files with 69 additions and 107 deletions

View file

@ -236,17 +236,17 @@ namespace System
///
public static TResult? operator+<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult = operator T + TOther where TResult : struct
public static TResult? operator+<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult : operator T + TOther where TResult : struct
{
if (!lhs.mHasValue) return null;
return Nullable<TResult>(lhs.mValue + rhs);
}
public static TResult? operator+<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult = operator TOther + T where TResult : struct
public static TResult? operator+<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult : operator TOther + T where TResult : struct
{
if (!rhs.mHasValue) return null;
return Nullable<TResult>(lhs + rhs.mValue);
}
public static TResult? operator+<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult = operator T + TOther where TResult : struct
public static TResult? operator+<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult : operator T + TOther where TResult : struct
{
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
return Nullable<TResult>(lhs.mValue + rhs.mValue);
@ -254,19 +254,19 @@ namespace System
///
public static TResult? operator-<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult = operator TOther - T where TResult : struct
public static TResult? operator-<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult : operator TOther - T where TResult : struct
{
if (!rhs.mHasValue) return null;
return Nullable<TResult>(lhs - rhs.mValue);
}
public static TResult? operator-<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult = operator T - TOther where TResult : struct
public static TResult? operator-<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult : operator T - TOther where TResult : struct
{
if (!lhs.mHasValue) return null;
return Nullable<TResult>(lhs.mValue - rhs);
}
public static TResult? operator-<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult = operator T - TOther where TResult : struct
public static TResult? operator-<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult : operator T - TOther where TResult : struct
{
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
return Nullable<TResult>(lhs.mValue - rhs.mValue);
@ -274,19 +274,19 @@ namespace System
//
public static TResult? operator*<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult = operator TOther * T where TResult : struct
public static TResult? operator*<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult : operator TOther * T where TResult : struct
{
if (!rhs.mHasValue) return null;
return Nullable<TResult>(lhs * rhs.mValue);
}
public static TResult? operator*<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult = operator T * TOther where TResult : struct
public static TResult? operator*<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult : operator T * TOther where TResult : struct
{
if (!lhs.mHasValue) return null;
return Nullable<TResult>(lhs.mValue * rhs);
}
public static TResult? operator*<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult = operator T * TOther where TResult : struct
public static TResult? operator*<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult : operator T * TOther where TResult : struct
{
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
return Nullable<TResult>(lhs.mValue * rhs.mValue);
@ -294,19 +294,19 @@ namespace System
//
public static TResult? operator/<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult = operator TOther / T where TResult : struct
public static TResult? operator/<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult : operator TOther / T where TResult : struct
{
if (!rhs.mHasValue) return null;
return Nullable<TResult>(lhs / rhs.mValue);
}
public static TResult? operator/<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult = operator T / TOther where TResult : struct
public static TResult? operator/<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult : operator T / TOther where TResult : struct
{
if (!lhs.mHasValue) return null;
return Nullable<TResult>(lhs.mValue / rhs);
}
public static TResult? operator/<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult = operator T / TOther where TResult : struct
public static TResult? operator/<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult : operator T / TOther where TResult : struct
{
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
return Nullable<TResult>(lhs.mValue / rhs.mValue);
@ -314,19 +314,19 @@ namespace System
//
public static TResult? operator%<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult = operator TOther % T where TResult : struct
public static TResult? operator%<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult : operator TOther % T where TResult : struct
{
if (!rhs.mHasValue) return null;
return Nullable<TResult>(lhs % rhs.mValue);
}
public static TResult? operator%<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult = operator T % TOther where TResult : struct
public static TResult? operator%<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult : operator T % TOther where TResult : struct
{
if (!lhs.mHasValue) return null;
return Nullable<TResult>(lhs.mValue % rhs);
}
public static TResult? operator%<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult = operator T % TOther where TResult : struct
public static TResult? operator%<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult : operator T % TOther where TResult : struct
{
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
return Nullable<TResult>(lhs.mValue % rhs.mValue);
@ -334,19 +334,19 @@ namespace System
//
public static TResult? operator^<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult = operator TOther ^ T where TResult : struct
public static TResult? operator^<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult : operator TOther ^ T where TResult : struct
{
if (!rhs.mHasValue) return null;
return Nullable<TResult>(lhs ^ rhs.mValue);
}
public static TResult? operator^<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult = operator T ^ TOther where TResult : struct
public static TResult? operator^<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult : operator T ^ TOther where TResult : struct
{
if (!lhs.mHasValue) return null;
return Nullable<TResult>(lhs.mValue ^ rhs);
}
public static TResult? operator^<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult = operator T ^ TOther where TResult : struct
public static TResult? operator^<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult : operator T ^ TOther where TResult : struct
{
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
return Nullable<TResult>(lhs.mValue ^ rhs.mValue);
@ -354,19 +354,19 @@ namespace System
//
public static TResult? operator&<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult = operator TOther & T where TResult : struct
public static TResult? operator&<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult : operator TOther & T where TResult : struct
{
if (!rhs.mHasValue) return null;
return Nullable<TResult>(lhs & rhs.mValue);
}
public static TResult? operator&<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult = operator T & TOther where TResult : struct
public static TResult? operator&<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult : operator T & TOther where TResult : struct
{
if (!lhs.mHasValue) return null;
return Nullable<TResult>(lhs.mValue & rhs);
}
public static TResult? operator&<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult = operator T & TOther where TResult : struct
public static TResult? operator&<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult : operator T & TOther where TResult : struct
{
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
return Nullable<TResult>(lhs.mValue & rhs.mValue);
@ -374,19 +374,19 @@ namespace System
//
public static TResult? operator|<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult = operator TOther | T where TResult : struct
public static TResult? operator|<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult : operator TOther | T where TResult : struct
{
if (!rhs.mHasValue) return null;
return Nullable<TResult>(lhs | rhs.mValue);
}
public static TResult? operator|<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult = operator T | TOther where TResult : struct
public static TResult? operator|<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult : operator T | TOther where TResult : struct
{
if (!lhs.mHasValue) return null;
return Nullable<TResult>(lhs.mValue | rhs);
}
public static TResult? operator|<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult = operator T | TOther where TResult : struct
public static TResult? operator|<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult : operator T | TOther where TResult : struct
{
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
return Nullable<TResult>(lhs.mValue | rhs.mValue);
@ -399,19 +399,19 @@ namespace System
return (lhs.mHasValue) ? lhs.mValue : rhs;
}
public static TResult? operator??<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult = operator TOther ?? T where TResult : struct
public static TResult? operator??<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult : operator TOther ?? T where TResult : struct
{
if (!rhs.mHasValue) return null;
return Nullable<TResult>(lhs ?? rhs.mValue);
}
public static TResult? operator??<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult = operator T ?? TOther where TResult : struct
public static TResult? operator??<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult : operator T ?? TOther where TResult : struct
{
if (!lhs.mHasValue) return null;
return Nullable<TResult>(lhs.mValue ?? rhs);
}
public static TResult? operator??<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult = operator T ?? TOther where TResult : struct
public static TResult? operator??<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult : operator T ?? TOther where TResult : struct
{
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
return Nullable<TResult>(lhs.mValue ?? rhs.mValue);
@ -419,19 +419,19 @@ namespace System
//
public static TResult? operator<< <TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult = operator TOther << T where TResult : struct
public static TResult? operator<< <TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult : operator TOther << T where TResult : struct
{
if (!rhs.mHasValue) return null;
return Nullable<TResult>(lhs << rhs.mValue);
}
public static TResult? operator<< <TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult = operator T << TOther where TResult : struct
public static TResult? operator<< <TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult : operator T << TOther where TResult : struct
{
if (!lhs.mHasValue) return null;
return Nullable<TResult>(lhs.mValue << rhs);
}
public static TResult? operator<< <TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult = operator T << TOther where TResult : struct
public static TResult? operator<< <TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult : operator T << TOther where TResult : struct
{
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
return Nullable<TResult>(lhs.mValue << rhs.mValue);