Esempio n. 1
0
 public bool Equals(NewType <T> other) =>
 !ReferenceEquals(other, null) &&
 GetType() == other.GetType() &&
 Value.Equals(other.Value);
Esempio n. 2
0
 public int CompareTo(NewType <T> other) =>
 !ReferenceEquals(other, null) &&
 GetType() == other.GetType()
         ? Comparer <T> .Default.Compare(Value, other.Value)
         : failwith <int>("Mismatched NewTypes used in comparison");
Esempio n. 3
0
 public NewType <T> Multiply(NewType <T> rhs) =>
 GetType() == rhs.GetType()
         ? (NewType <T>) NewType.Construct(GetType(), TypeDesc.Multiply(Value, rhs.Value, TypeDesc <T> .Default))
         : failwith <NewType <T> >("Mismatched NewTypes in multiply");
Esempio n. 4
0
 public NewType <T> Divide(NewType <T> rhs) =>
 GetType() == rhs.GetType()
         ? (NewType <T>) NewType.Construct(GetType(), TypeDesc.Divide(Value, rhs.Value, TypeDesc <T> .Default))
         : failwith <NewType <T> >("Mismatched NewTypes in divide");
Esempio n. 5
0
 public NewType <T> Subtract(NewType <T> rhs) =>
 GetType() == rhs.GetType()
         ? (NewType <T>) NewType.Construct(GetType(), TypeDesc.Subtract(Value, rhs.Value, TypeDesc <T> .Default))
         : failwith <NewType <T> >("Mismatched NewTypes in subtract");
Esempio n. 6
0
 public NewType <T> Append(NewType <T> rhs) =>
 GetType() == rhs.GetType()
         ? (NewType <T>) NewType.Construct(GetType(), TypeDesc.Append(Value, rhs.Value, TypeDesc <T> .Default))
         : failwith <NewType <T> >("Mismatched NewTypes in append/add");