any news on const/invariant?

Janice Caron caron800 at googlemail.com
Wed Nov 28 11:28:37 PST 2007


On 11/28/07, Sean Kelly <sean at f4.ca> wrote:
> You claimed that D does not
> have storage classes.  Could you explain this?

Certainly. In the grammar of C and C++, a rule is defined called
"storage-class-specifier". The "storage-class-specifier" grammar rule
forms part of the rule defining the syntax of a declaration. There is
no corresponding grammar element in D.

The storage class specifiers in C and C++ are auto, extern, mutable,
register, static and typedef. See the grammar at
http://www.kuzbass.ru:8086/docs/isocpp/gram.html

The closest grammar element D has is "attribute". This is defined on
the web page.
http://www.digitalmars.com/d/attribute.html. D attributes are
deprecated, static, final, override, abstract, const, auto, scope, and
various other constructs as defined on that page.

Though there is overlap between C's storage classes and D's
attributes, they are not completely identical, and in consequence,
some analogies don't work.



More information about the Digitalmars-d mailing list