Using traits how do i get a function's parameters as a string?

Andrej Mitrovic andrej.mitrovich at gmail.com
Wed Sep 4 04:54:18 PDT 2013


On 9/3/13, Adam D. Ruppe <destructionator at gmail.com> wrote:
> On Tuesday, 3 September 2013 at 21:20:04 UTC, Andrej Mitrovic
> wrote:
>>         foreach (id; ParameterIdentifierTuple!func)
>
> How do I keep missing these new std.traits things? Very nice.
>

It's really funky that an is() expression is used to extract this:

static if (is(FunctionTypeOf!func PT == __parameters)) { }

I'd assume it would be __traits(getParams, ...).


More information about the Digitalmars-d-learn mailing list