Vector.opUnary

Performs an unary operation on the vector.

struct Vector(T, char[] c)
typeof(this)
opUnary
(
string op
)
()
if (
__traits(compiles, )
)
if (
c.length > 1 &&
areValidCoordinates(c)
)

Return Value

Type: typeof(this)

the new vector

Examples

auto v = vector(-1, 0, 1);
assert(-v == vector(1, 0, -1));
assert(++v == vector(0, 1, 2)); // this will change the original vector's values!
assert(v-- == vector(0, 1, 2) && v == vector(-1, 0, 1));

Meta