<p dir="ltr">On 10 Oct 2014 17:35, "Walter Bright via Digitalmars-d" <<a href="mailto:digitalmars-d@puremagic.com">digitalmars-d@puremagic.com</a>> wrote:<br>
><br>
> On 10/10/2014 8:15 AM, Martin Nowak wrote:<br>
>>><br>
>>> const is used both as a storage class and as a type constructor, and is<br>
>>> distinguished by the grammar:<br>
>>><br>
>>>     const(T) v; // type constructor, it affects the type T<br>
>>><br>
>>>     const T v;  // storage class, affects the symbol v and the type of v<br>
>><br>
>><br>
>> That on it's own is fairly difficult to explain.<br>
><br>
><br>
> 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.<br>
></p>
<p dir="ltr">You shouldn't be blaming C++ for mistakes that D made.</p>
<p dir="ltr">> This problem is why we chose the const(T) syntax for type construction.<br>
><br>
> As for "what is a storage class" is there any confusion about:<br>
><br>
>     static T v;<br>
><br>
> ? I don't think so.<br>
></p>
<p dir="ltr">Equally, static does not have a double-meaning. </p>
<p dir="ltr">Iain.</p>