www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Mysterious identifier in std.traits.ParameterStorageClassTuple

reply Jean-Louis Leroy <jl leroy.nyc> writes:
What is `PT` here: 
https://github.com/dlang/phobos/blob/master/std/traits.d#L1224
Where does it come from?
Jul 24 2018
next sibling parent Jens <foo bar.com> writes:
On Tuesday, 24 July 2018 at 21:05:05 UTC, Jean-Louis Leroy wrote:
 What is `PT` here: 
 https://github.com/dlang/phobos/blob/master/std/traits.d#L1224
 Where does it come from?
`PT` is an identifier chosen by the programmer (see https://dlang.org/spec/expression.html#is_expression; specifically the 7th form) to denote the type of the parameters of a function as a tuple in the mentioned code. Add a `pragma(msg, PT)` (maybe needs to be `pragma(msg, PT.stringof)`; I didn't check) and see what it outputs. Jens
Jul 24 2018
prev sibling parent reply arturg <var.spool.mail700 gmail.com> writes:
On Tuesday, 24 July 2018 at 21:05:05 UTC, Jean-Louis Leroy wrote:
 What is `PT` here: 
 https://github.com/dlang/phobos/blob/master/std/traits.d#L1224
 Where does it come from?
https://dlang.org/spec/expression.html#is_expression look for 6. is ( Type Identifier == TypeSpecialization )
Jul 24 2018
parent Jens <foo bar.com> writes:
On Tuesday, 24 July 2018 at 21:34:34 UTC, arturg wrote:
 On Tuesday, 24 July 2018 at 21:05:05 UTC, Jean-Louis Leroy 
 wrote:
 What is `PT` here: 
 https://github.com/dlang/phobos/blob/master/std/traits.d#L1224
 Where does it come from?
https://dlang.org/spec/expression.html#is_expression look for 6. is ( Type Identifier == TypeSpecialization )
Yes, 6 is right. I was wrong with 7. And 6 also says for `__parameters: the parameter sequence of a function, delegate, or function pointer. This includes the parameter types, names, and default values.` So `PT` refers to the parameter sequence. So not only the parameter types. Jens
Jul 24 2018