const question/suggestion

James Dennett jdennett at acm.org
Mon Jun 18 19:09:01 PDT 2007


Walter Bright wrote:
> Myron Alexander wrote:
>> const var = new SomeObject ();
> 
> The above line will fail because const declarations can only be
> initialized with something that can be evaluated at compile time. The
> example should be:
> 
>     const(SomeObject) var = new SomeObject();

Is there any way to use type deduction to avoid having
to repeat the SomeObject part of this?

-- James



More information about the Digitalmars-d-announce mailing list