There is a C library (which I cannot change) that supports a callback function of the type
void (*callback)(void *appContext, int eventid)
Does callback function need to be declared under extern "C"?
NO. extern "C" is necessary only when you are calling a C++ function directly, without the use of function pointers, from C. If function pointers are used, extern "C" is not required.
Can I use non-static member functions as callback?
NO. Non-static member functions of class A have an implicit first parameter corresponding to this pointer.
Can I use static member functions as callback?
YES, as long as signature matches with that of the callback.
Does it matter if the function is a template function or not?
NO, template function can be used as callbacks as long as signature of the instantiated template matches with the callback.