digitalmars.D - a problem with lvalues and opEquals
- BCS (27/27) Jul 28 2005 struct P
- Sean Kelly (2/2) Jul 28 2005 This works fine for me with DMD .128.
- BCS (2/4) Jul 29 2005 Linux or windows?? I'm on windows
struct P { real x; int opEquals(P v) {return fr(v) >= 0.999999;} static P Set(real xf) {P ret; ret.x=xf; return ret;} static const P NaN = {x:real.nan}; real fr(P v) {return x*v.x;} P fP(P v) { if(1) // line 15 return P.NaN; // line 16 return v; // line 17 } unittest { P X = Set(1); assert(X.fP(X) == X); // line 23 } }; /*** compiled with: dmd lib/pm.d -unittest -c -inline w/ line 15: lib/pm.d(23): X.fP(X) is not an lvalue w/o line 15: no errors I'm stumped. Should this work?? */
Jul 28 2005
In article <dcbfis$2r6p$1 digitaldaemon.com>, Sean Kelly says...This works fine for me with DMD .128. SeanLinux or windows?? I'm on windows
Jul 29 2005