RowCol.opBinary

A coordinate can be multiplied or divided by an integer.

  1. RowCol opBinary(RowCol rhs)
  2. RowCol opBinary(T rhs)
    struct RowCol
    @nogc
    opBinary
    const
    (
    string op
    T : coord_t
    )
    (
    T rhs
    )
    if (
    op == "*" ||
    op == "/"
    )

Examples

Multiply/divide a coord by a constant

assert(RowCol(1, 2) * -4 == RowCol(-4, -8));
assert(RowCol(4, -6) / 2 == RowCol(2, -3));

Meta