I'm trying to do an operation which is probably horribly platform-specific.
Basically I'm using dlsym() with a mangled function name to get a pointer to a class method. My problem is converting the returned void* to a void (MyClass::*_my_function_pointer)(void)
In windows I can do (FARPROC&)_my_function_pointer = GetProcAddress("mangled function name");
However I don't think it's working in Unix to do (void*&)_my_function_pointer = dlsym("mangled function name");
dlsym() is returning a non-NULL pointer, so I think that means I'm using the correct mangled name.
I'm not exactly sure, but after you set the pointer to NULL, you cast it to a reference to a void pointer. I've never tried that and somehow I doubt casting a pointer to a reference is a good idea. I don't think you want the &