Why isn't this expression const?

Stewart Gordon smjg_1998 at yahoo.com
Fri May 11 12:02:25 PDT 2007


"Brian Palmer" <d at brian.codekitchen.net> wrote in message 
news:f1t6en$t32$1 at digitalmars.com...
> This code won't compile:
>
> struct Vector3 { float x,y,z; }
> const Vector3 ROT_FORCE_CCW = {0, 400_000, 0};
> const Vector3 ROT_FORCE_CW  = {0, ROT_FORCE_CCW.y*-1, 0};
<snip>
> Am I doing something wrong, or is it just lack of compiler
> smarts?  I'm using (gdc 0.23, using dmd 1.007)

It's the compiler getting confused.

http://d.puremagic.com/issues/show_bug.cgi?id=609

Stewart. 



More information about the Digitalmars-d-learn mailing list