digitalmars.D - Mysterious identifier in std.traits.ParameterStorageClassTuple
- Jean-Louis Leroy (3/3) Jul 24 2018 What is `PT` here:
What is `PT` here: https://github.com/dlang/phobos/blob/master/std/traits.d#L1224 Where does it come from?
Jul 24 2018
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
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
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: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. JensWhat 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