Hi,
the last day i read through things like boost::bind, mem_fun, boost::function and google to find a proper way to pass a member function pointer to a function that takes a c-function pointer.
In my imagination I pass a member function pointer together with an object to some function, and it returns a c-function pointer, with the object address hard coded in it somehow.
so I'm looking for anything that is able to directly pass a's member f to the c-funtion.Code:struct A { void mem() {} }; void c_api_function( void(*fn)() ) { // do something with fn } int main() { A a; c_api_function(); // somehow pass &A::f of a }
nothing I read about seems to do this. I know the workarounds proposed in the c++ faq. but isn't there not a more elegant solution?
The closest thing I found is the thing the first poster mentioned here:
http://groups.google.com/group/comp....52115c6f839238
But I'm not feeling to be at the level of understanding c++ to use that.
Thanks for your ideas!