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 const
    opBinary
    (
    string op
    T : coord_t
    )
    (
    T rhs
    )
    if (
    op == "*" ||
    op == "/"
    )
  3. coord_t row;
  4. coord_t col;

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