[conv.mem] (original) (raw)

A prvalue of type “pointer to member of B of type cv T”, where B is a class type, can be converted to a prvalue of type “pointer to member of D of type cv T”, where D is a complete class derived ([class.derived]) from B.

If B is an inaccessible ([class.access]), ambiguous ([class.member.lookup]), or virtual ([class.mi]) base class of D, or a base class of a virtual base class ofD, a program that necessitates this conversion is ill-formed.

If class D does not contain the original member and is not a base class of the class containing the original member, the behavior is undefined.

Otherwise, the result of the conversion refers to the same member as the pointer to member before the conversion took place, but it refers to the base class member as if it were a member of the derived class.

The result refers to the member in D's instance of B.

Since the result has type “pointer to member of D of type cv T”, indirection through it with a D object is valid.

The result is the same as if indirecting through the pointer to member of B with theB subobject of D.

The null member pointer value is converted to the null member pointer value of the destination type.46