shadow:standard

Interface CanSubtract<T>

interface CanSubtract<T>

Interface CanSubtract<T> specifies that a class can be subtracted by an object of type T, producing a T. This interface allows overloading of the binary - operator. If the binary - operator is applied, the appropriate subtract(T) method will be called. Although this interface allows the binary - operator to be overloaded with arbitrary functionality for any class, it is intended to make operations between numerical classes more readable.

Method Summary

Modifiers Return Types Method and Description
public readonly (T) subtract(T other)

Method called when the binary - operator is overloaded.

Method Detail

subtract

public readonly subtract(T other) => (T)

Method called when the binary - operator is overloaded.

Parameters

other - object to subtract by

Returns

result of the subtraction