A pointer to non-static class member type is not the same as a object pointer type; they behave very differently. In fact, you cannot even dereference a pointer to member with *
. To access a member through a pointer to member, you use the .*
and ->*
operators instead. If you could cast it to an object pointer type like this, what would happen, then, if you dereferenced it with *
?
Only object pointer types have a standard conversion to void*
(§4.10):
A prvalue of type "pointer to cv
T
," whereT
is an object type, can be converted to a prvalue of type "pointer to cvvoid
".
They're so different that the standard even goes out of its way to make sure that the term "pointer" doesn't include pointers to non-static members (§3.9.2):
Except for pointers to static members, text referring to "pointers" does not apply to pointers to members.