Pointer-to-member conversion can occur when pointers to members are
initialized, assigned, or compared. Note that pointer to a member is
not the same as a pointer to an object or a pointer to a function.
A constant expression that evaluates to zero can be converted to the null
pointer to a member.
A pointer to a member of a base class can be converted to a pointer to a
member of a derived class if the following conditions are true:
- The conversion is not ambiguous. The conversion is ambiguous if
multiple instances of the base class are in the derived class.
- A pointer to the derived class can be converted to a pointer to the base
class. If this is the case, the base class is said to be
accessible.
- Member types must match. For example suppose class A is
a base class of class B. You cannot convert a pointer to
member of A of type int to a pointer to member of type
B of type float.
- The base class cannot be virtual.
Related References
