const a storage class or a type modifier?

Jens Mueller jens.k.mueller at gmx.de
Thu Nov 25 15:00:49 PST 2010


Hi,

I'm converting a .h to a d module. I'm following the guide on
http://www.digitalmars.com/d/2.0/htomodule.html
It says
"D has const as a storage class, not a type modifier. Hence, just drop
any const used as a type modifier"

I do not understand the first sentence nor do I find dropping the const
right. Why should I drop a const?
In TDPL const/immutable are type qualifiers. Type qualifier is a
synonym for type modifier, isn't it? And I know storage classes like
static/ref. In C you have the type qualifiers const, volatile, and
restrict and the storage classes auto, register, static, extern. Now
const in D is a storage class?

Jens


More information about the Digitalmars-d mailing list