[Issue 9608] Add introspection for templates

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat May 10 07:43:00 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=9608

--- Comment #7 from Andrej Mitrovic <andrej.mitrovich at gmail.com> ---
(In reply to Jacob Carlborg from comment #6)
> Would it be possible to get the parameter types of a lambda which has some
> parameter types specified and some not? In that case I would expect "void"
> to be returned for those parameters that don't have a specified type.
> 
> (int a, b) => a + b

This probably expands to:

void func(T)(int a, T b);

Therefore it has 1 template parameter. If you use
__traits(getTemplateParamCount, lambda) it will return 1.

--


More information about the Digitalmars-d-bugs mailing list