Is there a simple way to pass the current instance of a non-static member function as a callback function in a shared library? The following structure returns "invalid use of non-static member function"
1 2 3 4 5 6 7 8 9 10 11 12
class c{
int bar (int a){
...
}
int lib_f{
return shared_library_function(6, bar)
//shared_library_function(int a, (*cb)(int)) is the syntax, I want it to
//invoke bar from the current object with parameter a.
}
}