Why aren't pointers to member functions just memory address like data pointers

c, c++

Solution

pointers to members are not memory addresses exactly like pointers to data! Why so?

Pointers to member functions need to indicate whether the function is virtual, and allow virtual dispatch (perhaps by specifying the index into the vtable, rather than the address of a specific function) if so. This makes them more complicated than just an address.

And this isn't necessarily with member functions but any normal C functions as well, isn't?

Pointers to "normal" (non-member) functions may be converted to object pointers, but not portably. Quoting the standard:

C++11 5.2.10/8 Converting a function pointer to an object pointer type or vice versa is conditionally-supported. The meaning of such a conversion is implementation-defined, [...]

On many platforms, a (non-member) function pointer is simply a memory address, and the conversion is well-defined. Some platforms have more exotic memory architectures - for example, separate memory spaces for instructions and data - and the conversion may not be allowed on those platforms.

Problem

I realized from this FAQ entry that one cannot convert a pointer to member function to/from `void*`. The reason being pointers to members are not memory addresses exactly like pointers to data! Why so? Please help me get clarified. And this isn't necessarily with member functions but any normal C functions as well, isn't?

Original source