interface CanNegate<T>
Interface CanNegate<T>
specifies that a class can be negated, producing an object of type T
. This interface allows overloading of the unary -
operator. If the unary -
operator is applied, the appropriate negate()
method will be called. Although this interface allows the unary -
operator to be overloaded with arbitrary functionality for any class, it is intended to make operations on numerical classes more readable.
Modifiers | Return Types | Method and Description |
---|---|---|
public readonly |
(T) |
negate() Method called when the unary |
public readonly negate() => (T)
Method called when the unary -
operator is overloaded.
negated version of object