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

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

Messages

Date: 2022-11-20.07:54:16
N2800 comment CH 1

Currently both implicit (7.3.13 [conv.mem]) and explicit (7.6.1.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.)

EWG 2022-11-11

The change is plausible, but needs a paper to EWG.

History
Date User Action Args
2022-11-20 07:54:16adminsetstatus: extension -> nad
2009-11-08 00:00:00adminsetstatus: open -> extension
2009-03-03 00:00:00admincreate