Help - can't ADD constness

Janice Caron caron800 at googlemail.com
Fri Sep 14 00:59:01 PDT 2007


This won't compile under D2.004

 class A
 {
     int x;
 }

 void main()
 {
     const a = new A(); /* Error */
 }

The error is
Error: non-constant expression cast(const A)new A

Now what's going on here? Are we not allowed to turn mutables into consts now?



More information about the Digitalmars-d mailing list