DMD 1.025 and 2.009 releases

Walter Bright newshound1 at digitalmars.com
Tue Jan 1 16:59:51 PST 2008


Jarrett Billingsley wrote:
> "Walter Bright" <newshound1 at digitalmars.com> wrote in message 
> news:flebgf$1pmb$1 at digitalmars.com...
> 
>> C cx;
>> if (someCondition)
>> cx = new C(1);
>> else
>> cx = new C(2);
>> const(C) c = cx;
> 
> ... 

Note that this isn't any different from what you'd write for a const int:

     int ix;
     if (someCondition)
	ix = 1;
     else
	ix = 2;
     const(int) i = ix;

or const of any type.



More information about the Digitalmars-d-announce mailing list