I have a simple code
class a{ public: double (a::*fun)(const double &) const; // .... // }; class b{ public: a c1; double f(const double & x) const{ return 0; } b(){ c1.fun = f; } }; It mean class "a" must work with functions of a certain type, and his work does not depend of this function realization (for example algebraic interpolation). I want make parameter of class - function. But I have some problem. Compiler write
a value of type "int (b::)(const int &x) const" cannot be assigned to an entity of type "int (a::)(const int &) const"
How it's made correct?