http://d.puremagic.com/issues/show_bug.cgi?id=7774
Summary: I've found a bug in D2 Product: D Version: D2 Platform: x86 OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: vangelisfore...@yandex.ru --- Comment #0 from Andrey Derzhavin <vangelisfore...@yandex.ru> 2012-03-25 12:33:25 PDT --- Try next code: import std.stdio; template TX(T) { struct A { T x; T y; public void opOpAssign(string op)(double d) { debug writeln(op); if (op == "+")// += { x += cast(T)d; y += cast(T)d; } else if (op == "-") // -= { x -= cast(T)d; y -= cast(T)d; } else if (op == "*") // *= { x *= cast(T)d; y *= cast(T)d; } else if (op == "/") // /= { x /= cast(T)d; y /= cast(T)d; } else if (op == "%") // %= { x %= cast(T)d; y %= cast(T)d; } } } } void main(string[] args) { TX!(double).A a; a.x =10; a.y = 10; a%=8.0; writeln(a.x, " ", a.y); } You'll see that the a.x won't change. It must be 2 after %= operation. Thank you. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------