Vector.this

Constructs a Vector from static array.

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

Examples

alias Vec2 = Vector!(float, 2);
Vec2 v;
v = Vec2([1, 2]);
assert(v == [1f, 2f]);
v = Vec2([2.0, 3.0]);
assert(v == [2f, 3f]);
v = Vec2([3.0f, 4.0f]);
assert(v == [3f, 4f]);

Meta