What I am trying to accomplish is registering a callback in an embedded environment. This callback will be in one of two forms:
void (*cb) (void *ctxt); or
void ClassA::VirtualFn (void);
This code will only run on an ARM platform using GCC. The register callback function MUST be virtual due to some dynamic binding done at runtime. Both the above functions are equivalent at the assembly level (they both take a single pointer). Furthermore the callback mechanism is in assembly for performance purposes because it occurs in ISR context so I don't have to worry about that. All I really need is a function that takes either of the above and stores the passed function pointer and context pointer. ie:
void isr_cb (void *ctxt) {}
gpio->RegisterIsr (isr_cb, cptr);
gpio->RegisterIsr (&ClassA::IsrHandler, this);
I've tested this by casting the virtual member function to (void (*) (void *))
and indeed everything works as expected (apart from the compiler warnings).