On Thursday, 3 September 2015 at 18:31:59 UTC, Meta wrote:

Worse than useless; it doesn't even behave as you would expect.

import std.stdio;

void main()
{
        auto a = -1;
        writeln(+a); //Prints -1
        writeln(-a); //Prints  1
}

At least unary - does something.

I mean, if behaves exactly as I'd expect. +(-1) must equal -1, as -(-1) produces +1.

Also, recall that you can overload the unary + operator, so it may behave differently for some aggregate types.

Reply via email to