class MyTestClass
{
public:
void DoSomething() {}
} and in main() showtype(&MyClass::DoSomething); I get the error 'void showtype(T *)' : could not deduce template argument for 'T *' from 'void (__thiscall MyTestClass::* )(int,float)' Obviously this is a member function pointer, and the code works if it were static, but I need to get arguments for it all the same. Anyone know how to get this working? While we're on the subject are there any other methods of doing this? Oddly, if I remove the * from the showtype definition, so it's just template<class T> void showtype(T t), it compiles, but the function traits then fail to resolve correctly. Any help or alternatives is greatly appreciated. Other than this it is working great for automatic binding code, such as this example
class MyTestClass
{
public:
int myint;
float myfloat;
bool mybool;
std::string mystring;
void DoSomething(int p1, float p2) {}
static void DoSomethingStatic0() {}
static void DoSomethingStatic1(int p1) {}
static void DoSomethingStatic2(int p1, float p2) {}
static void DoSomethingStatic3(int p1, float p2, const char *p3) {}
static void DoSomethingStatic4(bool p1, std::string p2) {}
private:
};
// And the bindings
gmMachine *pM = new gmMachine;
gmClass<MyTestClass>("MyTestClass", pM)
.var(&MyTestClass::myint, "myint")
.var(&MyTestClass::myfloat, "myfloat")
.var(&MyTestClass::mybool, "mybool")
.var(&MyTestClass::mystring, "mystring")
//.func(&MyTestClass::DoSomething,"DoSomething") <-- this part no workie
.staticfunc(&MyTestClass::DoSomethingStatic0, "Do0")
.staticfunc(&MyTestClass::DoSomethingStatic1, "Do1")
.staticfunc(&MyTestClass::DoSomethingStatic2, "Do2")
.staticfunc(&MyTestClass::DoSomethingStatic3, "Do3")
.staticfunc(&MyTestClass::DoSomethingStatic4, "Do4")
;