Extracting function param types using variadic templates

Jarrett Billingsley kb3ctd2 at yahoo.com
Fri Nov 3 12:46:12 PST 2006


Hmm.

I can do this:

void variadic(T...)(T args){}
variadic(1, 2, 3);

This:

void returnType(T)(T delegate() dg){}

returnType(delegate int(){ return 0; });

Even this:

void returnAndArg(T, U)(T delegate(U) dg){}
returnAndArg(delegate int(bool b){ return 0; });

But not:

void returnAndArgs(T, U...)(T delegate(U) dg){}
returnAndArgs(delegate int(bool b){ return 0; });

!

One can dream, no?

Is there maybe some other way to get at the parameter types of a function as 
a tuple, using variadic magic? 





More information about the Digitalmars-d mailing list