D - constant evaluation with conditional expression
- Yung-Hei, Lee (14/14) May 19 2003 enum {A=1}
- Walter (1/1) May 20 2003 Yes, it should work. I'll add it to the bug list.
enum {A=1}
enum {B=A?0:1}
This simple constant assignment does not work.
This snippet generate following error message.
"non-constant expression 1 ? 0 : 1"
It obviously is constant expression, isn't it?
enum {A=1}
enum {B=A+1}
This works.
It looks that conditioanl expression never evaluated to constant value.
The same is true for "const" attribute.
const int i = 1;
const int j = i?0:1;
This code generates the same error message.
May 19 2003
Yes, it should work. I'll add it to the bug list.
May 20 2003








"Walter" <walter digitalmars.com>