   Boost - brent_find_minima problem
  This works (although with predefined values)void CtestDlg::OnBnClickedButton1(){doSomething();}double sinc(double x) {static const double PI = 3.14159265358979323846264338327950288419716939937510;return (x == 0.0) ? 1.0 : sin( PI * x ) / ( PI * x );}double x(double t) {static double vals[6] = { 5.0, 14.0, 60.0, 111.0, 100.0, 37.0 };double result = 0;for (int i = 0; i < 6; i++) result += vals * sinc(t-i);return -result;}typedef std::pair<double, double> Range;void CtestDlg::doSomething(){std::pair<double, double> mm = boost::math::tools::brent_find_minima(x, 0.0, 6.0, 64);}But if I make those functions class members and try to pass values like thisvoid CtestDlg::OnBnClickedButton1(){vals[0]=5.0;vals[1]=14.0;vals[2]=60.0;vals[3]=111.0;vals[4]=100.0;vals[5]=37.0;doSomething();}typedef std::pair<double, double> Range;void CtestDlg::doSomething(){std::pair<double, double> mm = boost::math::tools::brent_find_minima(x, 0.0, 6.0, 64);}double CtestDlg::sinc(double x) {static const double PI = 3.14159265358979323846264338327950288419716939937510;return (x == 0.0) ? 1.0 : sin( PI * x ) / ( PI * x );}double CtestDlg::x(double t) {//static double vals[6] = { 5.0, 14.0, 60.0, 111.0, 100.0, 37.0 }; -THIS CANCLED OUTdouble result = 0;for (int i = 0; i < 6; i++) result += vals * sinc(t-i);return -result;}I get errors:Error1error C3867: 'CtestDlg::x': function call missing argument list; use '&CtestDlg::x' to create a pointer to memberError2error C2780: 'std::pair<T,T> boost::math::tools::brent_find_minima(F,T,T,int,boost::uintmax_t &)' : expects 5 arguments - 4 providedand if I do type there &CtestDlg::x instead of just xI get error in boost itselfError1error C2064: term does not evaluate to a function taking 1 argumentsc:\program files\boost\boost_1_39\boost\math\tools\minima.hppHow can I fix it?(The program uses this values to define Y of the curve and mm is the x value where the curve has maximum)   
  Sorry for not answering your question.But I noticed you define the constant pi in your code.You can use boost::math::constants::pihttp://www.boost.org/doc/libs/1_42_0/libs/math/doc/sf_and_dist/html/math_toolkit/toolkit/internals1/constants.htmlIt gives you a better accuracy and as you already use boost then you might as well use their pi, too.   ;  Thanks!I solved the main problem by making vals[] global variable (unelegant but it works)   ;  The problem is that a member function must be converted to a functor before being able to be passed as a variable. The keyword here is binding (std::bind1st() etc.).I found a forum topic elsewhere that has an answer to exactly your question: http://www.velocityreviews.com/forums/t690259-function-that-requires-a-function-as-an-argument-brent_find_minima.html   