Vector.this

Construct a Vector from a single value

  1. this(Args args)
  2. this(V vec)
  3. this(valueType value)
    struct Vector(type, int dim)
    nothrow @nogc pure nothrow @nogc pure nothrow @nogc @safe
    this
    ()
    if (
    (dim >= 2) &&
    (dim <= 4)
    )

Examples

Unittest Construct a Vector from a single value

auto v2 = vec2( 2 );
assert( v2 == [ 2, 2 ] );

auto v3i = vec3i( 3 );
assert( v3i == [ 3, 3, 3 ] );

auto v4ub = vec4ub( 4 );
assert( v4ub == [ 4, 4, 4, 4 ] );

Meta