Is there a way to get the names of a function's parameters?

Simen kjaeraas simen.kjaras at gmail.com
Mon Jun 14 05:41:48 PDT 2010


Jacob Carlborg <doob at me.com> wrote:

> Here you go: http://tango.pastebin.com/M38jdhGd including calling using  
> named arguments.

Does not handle function/delegate return types.

struct S {}
void function(int delegate(float)) F(string delegate(), string  
function(string, string), float, double, S);	
writeln("Parameters: ", parameterNamesOf!F);

Gives:
Parameters: delegate(float

One needs to match parentheses from the last parentheses in the  
typeof.stringof.

-- 
Simen


More information about the Digitalmars-d mailing list