Matrix.opUnary

struct Matrix(T, ubyte R, ubyte C = R, MatrixOrder O = CurrentMatrixOrder)
pure nothrow const @safe @nogc
static if(O == MatrixOrder.RowMajor)
opUnary
(
string op
)
()
if (
op == "+" ||
op == "-"
||
op == "~"
||
op == "!"
)
if (
R >= 2 &&
R <= 4
&&
C >= 2
&&
C <= 4
)

Examples

auto m1 = Matrix2I(1, 3, /**/ -1, 0);
assert ((+m1).v == [1, 3, /**/ -1, 0]);
assert ((-m1).v == [-1, -3, /**/ 1, 0]);
assert ((~m1).v == [-2, -4, /**/ 0, -1]);
// *** BUG ***
//auto m2 = Matrix!(bool, 2)(true, true, /**/ false, false);
//assert ((!m2).v == [false, false, /**/ true, true]);

Meta