Vector.opUnary

struct Vector(T, ubyte N)
pure const nothrow @safe @nogc
opUnary
(
string op
)
()
if (
op == "+" ||
op == "-"
||
op == "~"
||
op == "!"
)
if (
N >= 2 &&
N <= 4
)

Examples

auto v1 = Vector2I(2, -5);
assert ((+v1).v == [2, -5]);
assert ((-v1).v == [-2, 5]);
assert ((~v1).v == [-3, 4]);
// *** BUG ***
//auto v2 = Vector!(bool, 2)(true, false);
//assert ((!v2).v == [false, true]);

Meta