Vector.opBinary

struct Vector(T, ubyte N)
const
opBinary
(
string op
U
)
(
U rhs
)
if (
N >= 2 &&
N <= 4
)

Examples

const v1 = Vector2I(4, -5);
const v2 = Vector2I(7, 2);
auto v3 = v1 + v2;
assert(v3.v == [11, -3]);
v3 = v2 - 2;
assert(v3.v == [5, 0]);

Meta