Make const, immutable, inout, and shared illegal as function attributes on the left-hand side of a function

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Sun Oct 12 05:28:58 PDT 2014


On 10/11/2014 11:17 PM, Dicebot wrote:
> On Saturday, 11 October 2014 at 17:27:22 UTC, monarch_dodra wrote:
>> On Saturday, 11 October 2014 at 12:45:40 UTC, Dicebot wrote:
>>> On Saturday, 11 October 2014 at 07:36:21 UTC, monarch_dodra wrote:
>>>>> Wait what? Are you saying there is a single case when this:
>>>>>
>>>>> const T var;
>>>>>
>>>>> is not identical to this:
>>>>>
>>>>> const(T) var;
>>>>
>>>> No, look at the pointer symbol.
>>>
>>> module test;
>>>
>>> const int**  a;
>>> const(int**) b;
>>
>> The original code you quoted was "const(T)* v;" where the "*" was
>> *outside* of the parens.
>
> There was no * in my quote, only `const(T)` vs `const T` (with any
> compound T)
>
> The fact that const T* means const(T*) does not indicate that const is a
> storage class but simply a parsing rule. Walter has made a statement
> that there is a const storage class that is distinct from const
> qualified. I want example.

As far as I understand, this is a compiler implementation detail.


More information about the Digitalmars-d mailing list