int Foo(int x) {
}
int Thing::Foo(int x) {
}
I'm trying to call a function that expects a void* InCallback, when I call it as Function(Foo) it does work.
When I try to call it Function(Thing::Foo) i get this error:
argument of type "int (Thing::*)(int x)" is incompatible with parameter of type "void *"
Is possible somehow to call the class function?
thisshould be in that call? How would you pass that value even theoretically? Ifthisis not actually used inThing::Foo(), just make itstatic.Thing::Foo(), you need two values:intargument andthispointer to an object. When a callbackvoid(int)is called via a function pointer, onlyintis passed to it. What aboutthis? How could it be passed?void* InCallbackis not a function pointer. The code is already suspect, since function pointers and data pointers are not interchangeable. Your Thing::Foo is probably not markedstaticin the declaration. If it were, the code should work (ignoring the data pointer and function pointer conflation).Functionis declared as<some type> Function(void *)?