Using function non-member of class inside this class
Hello, here some problem with using function NOT a member of class:
double function (double (*fun) (double),double a)
double M_func (double y)
the error - 49:40: error: cannot convert ‘double (SomeClass::*)(double, double)’ to ‘double (*)(double, double)’
i know it`s looks strange to set M like that, but in my real code i have to.
How to make it right?
It does really look weird. What's keeping you from simply doing
M = M_func(x);?
normal functions and member functions are two different things so you can't treat them the same.
Maybe you want to make M_func a static function?
Topic archived. No new replies allowed.