Vector.this

  1. this(U values)
    struct Vector(T, ubyte N)
    this
    (
    U...
    )
    ()
    if (
    N >= 2 &&
    N <= 4
    )
  2. this(Vector2!T xy, T z)
  3. this(Vector2!T xy, Vector2!T zw)
  4. this(Vector3!T xyz, T w)

Examples

const v1 = Vector2I(4, 2);
assert(v1.v == [4, 2]);
const v2 = Vector2I(5);
assert(v2.v == [5, 5]);
const v3 = Vector3I([1, 2, 3]);
assert(v3.v == [1, 2, 3]);
const v4 = Vector4I();
assert(v4.v == [0, 0, 0, 0]);
const v5 = Vector3I(Vector2I(1, 3), 5);
assert(v5.v == [1, 3, 5]);
const v6 = Vector4I(Vector3I(-2, 1, 3), 5);
assert(v6.v == [-2, 1, 3, 5]);
const v7 = Vector4I(Vector2I(1, 3), Vector2I(5, 4));
assert(v7.v == [1, 3, 5, 4]);

Meta