constant bug?

Josh N none at nowhere.com
Fri Apr 6 08:59:19 PDT 2007


Why doesn't this code compile?

const int a = 0;
const int foo = 4;
const int[1] bar = [foo * 2];
const int zap = (1 << bar[a]); // commented out compiles fine

I get the following error:

test.d(3): Error: non-constant expression foo * 2
test.d(4): Error: non-constant expression 1 << foo * 2





More information about the Digitalmars-d mailing list