Converting class function pointer to void* or vice versa
问题 Im trying to compare the address of two functions for equality. Type of my stored function is known. This system normally works, consider the following code (written as sample not from the program): virtual bool compare(void *fn2) { void (*fn)(int); if(fn==fn2) return true; } However when class functions came into consideration the same method doesn't work. virtual bool compare(void *fn2) { void(__thiscall myclass::*fn)(int); void *fn2; if(fn==fn2) //error C2440 type cast: cannot convert void