DMD 1.025 and 2.009 releases

BCS ao at pathlink.com
Tue Jan 1 18:46:44 PST 2008


Reply to Jarrett,

> "Walter Bright" <newshound1 at digitalmars.com> wrote in message
> news:fle8mi$1j24$2 at digitalmars.com...
> 
>> ???? (noshiika) wrote:
>> 
>> Replace:
>> 
>>> const(C) c;
>>> c = new C(1); // error
>> with:
>> 
>> const(C) c = new C(1);
>> 
> Solve:
> 
> const(C) c;
> 
> if(someCondition)
> c = new C(1);
> else
> c = new C(2);

const(C) c = 
    (someCondition) ?
             new C(1) :
             new C(2);

or:

const(C) c = new C((someCondition) ? 1 : 2);





More information about the Digitalmars-d-announce mailing list