Need help with storage class definition

Kenji Hara k.hara.pg at gmail.com
Mon Jan 14 07:17:29 PST 2013


On Monday, 14 January 2013 at 14:16:32 UTC, mist wrote:
> While working on 
> https://github.com/D-Programming-Language/phobos/pull/863 I 
> have noticed that inout breaks ParameterStorageClassTuple and 
> family. I have started working on a fix but quick comparison of 
> http://dlang.org/declaration.html#StorageClass vs 
> http://dlang.org/phobos/std_traits.html#.ParameterStorageClassTuple 
> have left me in confusion without clear understanding what 
> parameter storage classes are supposed to be defined to.
>
> There is also InOutX entry in grammar which lists some of 
> storage classes and seems more relevant to parameter storage 
> classes (i.e. includes ref).
>
> Can someone give a more structured explanation: what is 
> supposed to be a storage class, what is supposed to be a type 
> storage class and what - a type qualifier? I'd like to update 
> std.traits demanglers to the latest state of things, but 
> grammar description does not seem clear enough.

http://dlang.org/declaration.html#StorageClass
InOutX is the list of 'syntactically allowed' keywords.

Among them, these four are supported as actual 'parameter storage 
classes'.

scope
out
ref
lazy

In current, 'in' is directly replaced to 'const', and it is 
treated as a part of parameter type.
'inout' is also treated as a type qualifier, and then is the same.

Kenji Hara


More information about the Digitalmars-d-learn mailing list