const question/suggestion

Walter Bright newshound1 at digitalmars.com
Mon Jun 18 14:55:21 PDT 2007


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();

> var.changesomething() -- fails



More information about the Digitalmars-d-announce mailing list