
13 Jun
2007
13 Jun
'07
11:20 p.m.
"Kirit Sælensminde" <kirit.saelensminde@gmail.com> wrote
I've been playing around with a few functional programming idioms in C++ using Boost.function and Boost.lambda and was wondering if it was possible to fetch out the argument type (i.e. int) from a type like this:
void (*somefunc)( int )
You don't need any libraries for this -- just use partial template specialization: template<class T> struct deduce_arg; //not defined template<class A> struct deduce_arg<void(*)(A0)> { typedef A0 type; }; Regards, Arkadiy