From f18ec20cb4e7ec4fe84af9891053e542d69831a4 Mon Sep 17 00:00:00 2001 From: Walter Bright Date: Sat, 22 May 2010 01:38:28 +0000 Subject: [PATCH] update for change in opOpAssign --- std/complex.d | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/std/complex.d b/std/complex.d index db21c9e76..ad8894910 100644 --- a/std/complex.d +++ b/std/complex.d @@ -139,7 +139,7 @@ struct Complex(T) if (isFloatingPoint!T) { alias typeof(return) C; auto w = C(this.re, this.im); - return w.opOpAssign!(op~"=")(z); + return w.opOpAssign!(op)(z); } @@ -149,7 +149,7 @@ struct Complex(T) if (isFloatingPoint!T) { alias typeof(return) C; auto w = C(this.re, this.im); - return w.opOpAssign!(op~"=")(r); + return w.opOpAssign!(op)(r); } @@ -203,17 +203,17 @@ struct Complex(T) if (isFloatingPoint!T) // complex += complex, complex -= complex Complex opOpAssign(string op, C)(C z) - if ((op == "+=" || op == "-=") && is(C R == Complex!R)) + if ((op == "+" || op == "-") && is(C R == Complex!R)) { - mixin ("re "~op~" z.re;"); - mixin ("im "~op~" z.im;"); + mixin ("re "~op~"= z.re;"); + mixin ("im "~op~"= z.im;"); return this; } // complex *= complex Complex opOpAssign(string op, C)(C z) - if (op == "*=" && is(C R == Complex!R)) + if (op == "*" && is(C R == Complex!R)) { auto temp = re*z.re - im*z.im; im = im*z.re + re*z.im; @@ -224,7 +224,7 @@ struct Complex(T) if (isFloatingPoint!T) // complex /= complex Complex opOpAssign(string op, C)(C z) - if (op == "/=" && is(C R == Complex!R)) + if (op == "/" && is(C R == Complex!R)) { if (fabs(z.re) < fabs(z.im)) { @@ -250,7 +250,7 @@ struct Complex(T) if (isFloatingPoint!T) // complex ^^= complex Complex opOpAssign(string op, C)(C z) - if (op == "^^=" && is(C R == Complex!R)) + if (op == "^^" && is(C R == Complex!R)) { FPTemporary!T r = abs; FPTemporary!T t = arg; @@ -264,25 +264,25 @@ struct Complex(T) if (isFloatingPoint!T) // complex += numeric, complex -= numeric - Complex opOpAssign(string op, U : T)(U a) if (op == "+=" || op == "-=") + Complex opOpAssign(string op, U : T)(U a) if (op == "+" || op == "-") { - mixin ("re "~op~" a;"); + mixin ("re "~op~"= a;"); return this; } // complex *= numeric, complex /= numeric - Complex opOpAssign(string op, U : T)(U a) if (op == "*=" || op == "/=") + Complex opOpAssign(string op, U : T)(U a) if (op == "*" || op == "/") { - mixin ("re "~op~" a;"); - mixin ("im "~op~" a;"); + mixin ("re "~op~"= a;"); + mixin ("im "~op~"= a;"); return this; } // complex ^^= real Complex opOpAssign(string op, R)(R r) - if (op == "^^=" && isFloatingPoint!R) + if (op == "^^" && isFloatingPoint!R) { FPTemporary!T ab = abs^^r; FPTemporary!T ar = arg*r; @@ -294,7 +294,7 @@ struct Complex(T) if (isFloatingPoint!T) // complex ^^= int Complex opOpAssign(string op, U)(U i) - if (op == "^^=" && isIntegral!U) + if (op == "^^" && isIntegral!U) { switch (i) {