Comment #0 by bearophile_hugs — 2010-03-15T10:17:47Z
According to the specs of the new operator overloading this program is correct, but it currently doesn't compile:
struct Foo {
int x;
Foo opUnary(string op:"++")() {
this.x++;
return this;
}
}
void main() {
Foo f = Foo(5);
f++; // line 10
}
The compiler gives:
test.d(10): Error: var has no effect in expression (__tmp1)
Comment #1 by clugdbug — 2010-06-09T07:57:13Z
*** This issue has been marked as a duplicate of issue 4231 ***