&Derived::BaseClassMember
has type int Base::*
, not int Derived::*
. Quoth the Standard:
The result of the unary
&
operator is a pointer to its operand. The operand shall be an lvalue or a qualified-id. If the operand is a qualified-id naming a non-static memberm
of some classC
with typeT
, the result has type “pointer to member of classC
of typeT
” and is a prvalue designatingC::m
. [... skip ...] [Example:
struct A { int i; };
struct B : A { };
... &B::i ... // has type int A::*i
— end example]
You have to cast the value to int Derived::*
if you need this type.