const in dmd v2.011

Derek Parnell derek at nomail.afraid.org
Wed Feb 20 22:46:59 PST 2008


On Wed, 20 Feb 2008 22:39:03 -0500, Steven Schveighoffer wrote:

> I think some of the issues you point out, especially where you have 2 
> seemingly similar statements where one statement gives an error and the 
> other does not, are real bugs that should be filed.

After a bit more examination, it is probably not a bug but just a poor
error message. It turns out that 

  const(char[]) s = "abc";

is essentially treated as a manifest constant. It is almost identical to 

  enum (s = "abc"}

The person who can document all this 'const' implementation so that most
people can grasp it and remember it, will win lots of brownie points.

-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
21/02/2008 5:42:22 PM


More information about the Digitalmars-d-learn mailing list