Vector.this

Constructs a Vector from a Vector-like struct.

  1. this(T scalar)
  2. this(T[N] values)
  3. this(R range)
  4. this(U value)
    struct Vector(T, uint N)
    this
    (
    U
    )
    (
    const auto ref U value
    )
    if (
    is(U == struct) &&
    VectorStruct!U.isVectorStruct
    )
    if (
    N > 0
    )
  5. this(Args args)

Examples

Vec2 v = OtherVec2(2, 3);
assert(v == Vec2(2, 3));
Vec4 v4 = OtherVec2(4, 5);
assert(v4 == Vec4(4, 5, 0, 0));
assert(!__traits(compiles, { Vec2 v = NotAVec2(); }));

Meta