is this a bug? opUnary!++ Error: var has no effect

2012-02-08 Thread Zach the Mystic
My goal is to be able to overload the ++ operator transparently to the code, but I can't. import std.stdio; struct Arc { int I = 0; // This is void, but the error appears under all return types void opUnary(string op)() if( op == ++ ) { ++I; } } struct HasArc { Arc

Re: is this a bug? opUnary!++ Error: var has no effect

2012-02-08 Thread Timon Gehr
On 02/08/2012 10:48 PM, Zach the Mystic wrote: My goal is to be able to overload the ++ operator transparently to the code, but I can't. import std.stdio; struct Arc { int I = 0; // This is void, but the error appears under all return types void opUnary(string op)() if( op == ++ ) { ++I; } }