Vector.this

Constructs a Vector with all elements equal to scalar

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

Examples

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

Meta