On 10 Oct 2014 17:35, "Walter Bright via Digitalmars-d" < [email protected]> wrote: > > On 10/10/2014 8:15 AM, Martin Nowak wrote: >>> >>> const is used both as a storage class and as a type constructor, and is >>> distinguished by the grammar: >>> >>> const(T) v; // type constructor, it affects the type T >>> >>> const T v; // storage class, affects the symbol v and the type of v >> >> >> That on it's own is fairly difficult to explain. > > > I can blame C++ for that, because in C++ the difference between const as storage class and as type constructor is much more subtle than in D, but it has critical affects. >
You shouldn't be blaming C++ for mistakes that D made. > This problem is why we chose the const(T) syntax for type construction. > > As for "what is a storage class" is there any confusion about: > > static T v; > > ? I don't think so. > Equally, static does not have a double-meaning. Iain.
