DMD 1.025 and 2.009 releases
Jason House
jason.james.house at gmail.com
Tue Jan 1 20:17:58 PST 2008
Walter Bright wrote:
> Jason House wrote:
>> Has the const/invariant/enum documentation been updated yet?
>> Looking at http://www.digitalmars.com/d/const3.html, there is no mention
>> of
>> enum. It does discuss manifest constants...
>>
>> Can you please update the docs to reflect the new design?
>
> See http://www.digitalmars.com/d/enum.html for the enum stuff.
... so you're saying that I can define manifest constants in several
different ways? Quoting the online docs:
"The simplest invariant declarations use it as a storage class. It can be
used to declare manifest constants.
invariant int x = 3; // x is set to 3"
I thought manifest constants were going to be made more explicit. That way,
it's known when taking an address of something is valid. Afterall, the
docs also say:
"Invariant used as a storage class is equivalent to using invariant as a
type constructor for the entire type of a declaration:
invariant int x = 3; // x is typed as invariant(int)
invariant(int) y = 3; // y is invariant"
... after all the discussion about const/invariant/manifest, I think the
docs should be very clear on this topic. I don't want to see more long
threads about manifest constants.
More information about the Digitalmars-d-announce
mailing list