Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Back to Docs_main.

pyd.ftype

This module contains templates for inferring the number of arguments, the return type, and argument types of an arbitrary function pointer.

Portions of this module were automatically generated by Python modules.

Authors:
Daniel Keep, Tomasz Stachowiak

Date:
Fri Jun 23 20:44:59 2006

template NumberOfArgs(Tf)
Derives the number of arguments the passed function type accepts. It only works on functions with 10 or fewer arguments.

template ReturnType(T)
Derives the return type of the passed function type.

template ArgType(Tf,uint n)
Derives the type of an individual argument of function Tf.

Params:
Tf A function pointer type
n The 1-indexed function argument to get the type of, e.g.:
int func(int, char, real);
static assert( is(char == ArgType(&func;, 2)) );