Title
Base-derived conversion in member type of pointer-to-member conversion
Status
extension
Section
7.12 [conv.mem]
Submitter
CH

Created on 2009-03-03.00:00:00 last changed 129 months ago

Messages

Date: 2009-03-03.00:00:00
N2800 comment CH 1

Currently both implicit (7.12 [conv.mem]) and explicit (8.2.9 [expr.static.cast]) conversions of pointers to members permit only cases in which the type of the member is the same except for cv-qualification. It would seem reasonable to allow conversions in which one member type is a base class of the other. For example:

    struct B { };
    struct D: B { };
    struct X {
        D d;
    };
    struct Y: X { };
    B Y::* pm = &X::d;  // Currently ill-formed: type of d is D, not B

(See also issue 170.)

History
Date User Action Args
2009-11-08 00:00:00adminsetstatus: open -> extension
2009-03-03 00:00:00admincreate