[ERROR]
Pointer to member is defined to point on a class member, then classes (the one which member belongs to and the one where the pointer to member points) have to be identical. If the member is inherited from a base class then classes can be different.
class A{
public:
int a;
void fct1(void){}
};
class B{
public:
int b;
void fct2(void){}
};
void main(void){
int B::*pmi = &A::a;
void (B::*pmf)() = &A::fct1;
}
Use the same classes
class A{
public:
int a;
void fct1(void){}
};
class B{
public:
int b;
void fct2(void){}
};
void main(void){
int A::*pmi = &A::a;
void (A::*pmf)() = &A::fct1;
}
Use classes which derive one from an other
class A{
public:
int a;
void fct1(void){}
};
class B : public A{
public:
int b;
void fct2(void){}
};
void main(void){
int B::*pmi = &A::a;
void (B::*pmf)() = &A::fct1;
}