Vector.opOpAssign

Assign result of applying operator with other to elements.

  1. Vector opOpAssign(T scalar)
  2. Vector opOpAssign(T[M] other)
    struct Vector(T, uint N)
    pure ref return
    opOpAssign
    (
    string op
    uint M
    )
    (
    const auto ref T[M] other
    )
    if (
    !op.among("~", "<<", ">>", ">>>")
    )
    if (
    N > 0
    )

Examples

Vec3 v = [1, 2, 3];
v += Vec2(1, 2);
assert(v == [2, 4, 3]);

v += Vec4(1, 2, 3, 4);
assert(v == [3, 6, 6]);

Meta