www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Re: Why isn't this expression const?

Stewart Gordon Wrote:

 "Brian Palmer" <d brian.codekitchen.net> wrote in message 
 news:f1t6en$t32$1 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};

 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.

That clears things up. Thanks all for the great answers, I'll just work around it for now.
May 11 2007