Use Boost to get arity and paramerter types of member function? (boost::function_traits)
Boost Function Types would probably be the natural solution:
#include <boost/function_types/function_type.hpp>
#include <boost/function_types/parameter_types.hpp>
#include <boost/function_types/function_arity.hpp>
#include <boost/typeof/std/utility.hpp>
#include <iostream>
struct bar {
int foo(int, char) { return 0; }
};
int main() {
typedef BOOST_TYPEOF(&bar::foo) foo_type;
std::cout << typeid(foo_type).name() << std::endl;
std::cout << boost::function_types::function_arity<foo_type>::value << std::endl;
std::cout << typeid(boost::mpl::at_c<boost::function_types::parameter_types<foo_type>,1>::type).name() << ",";
std::cout << typeid(boost::mpl::at_c<boost::function_types::parameter_types<foo_type>,2>::type).name() << ",";
return 0;
}