Pointers to elements differ from ordinary function pointers. Since a compiler error indicates that the type &A::dosomeA is actually int (A::*)(int) , not int (*)(int) .
Inside constructor B you will need an instance of A to call a member when using one of the operators .* Or ->* .
eg
B(int(A::*ptr)(int)) { A atmp; (atmp.*ptr)(int); }
source share