草庐IT

paramerter

全部标签

c++ - 使用Boost获取成员函数的arity和paramerter类型? ( boost::函数特性)

对于普通函数,它工作得很好。下面的代码工作得很好。它只打印应有的内容:int__cdecl(int,char)2int,char#include#include#include#includeusingstd::cout;usingstd::endl;intfoo(int,char){return0;}intmain(){typedefBOOST_TYPEOF(foo)foo_type;;typedefboost::function_traitsfunction_traits;cout那么,问题是,如果foo是类bar的成员函数,我们该如何做到这一点?structbar{intfoo(