Matrix.this

struct Matrix(T, ubyte R, ubyte C = R)
this
(
U...
)
()
if (
R >= 2 &&
R <= 4
&&
C >= 2
&&
C <= 4
)

Examples

// Create a matrix using all values.
const matrix1 = Matrix!(int, 2)(1, 2, 3, 4);
assert(matrix1.v == [1, 2, /**/ 3, 4]);
// Create a matrix from one value.
const matrix2 = Matrix!(float, 2)(5.2f);
assert(matrix2.v == [5.2f, 5.2f, /**/ 5.2f, 5.2f]);
// Create a matrix with no value (implicit 0).
const matrix3 = Matrix!(short, 2)();
assert(matrix3.v == [0, 0, /**/ 0, 0]);

Meta