1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-21 09:27:59 +02:00

IOpSubtractable

The opposite of IOpAddable, useful for generic code.
This commit is contained in:
Damian Day 2020-03-20 22:01:18 +00:00
parent 96c53d4a9e
commit 9a8beec7d9
11 changed files with 63 additions and 8 deletions

View file

@ -1,6 +1,6 @@
namespace System
{
struct Int16 : int16, IInteger, ISigned, IHashable, IFormattable, IOpComparable, IIsNaN, IOpNegatable, IOpAddable
struct Int16 : int16, IInteger, ISigned, IHashable, IFormattable, IOpComparable, IIsNaN, IOpNegatable, IOpAddable, IOpSubtractable
{
public const int32 MaxValue = 0x7FFF;
public const int32 MinValue = -0x8000;
@ -15,6 +15,11 @@ namespace System
return (SelfBase)lhs + (SelfBase)rhs;
}
public static Self operator-(Self lhs, Self rhs)
{
return (SelfBase)lhs - (SelfBase)rhs;
}
public static Self operator-(Self value)
{
return (SelfBase)value;