title: Pointer to a C++ class member function as a global function's parameter?
body: <p><em>I have got a problem with calling a global function, which takes a pointer to a function as a parameter.
  Here is the declaration of the global function:</em></p>
  
  <pre><code>int lmdif ( minpack_func_mn fcn, void *p, int m, int n, double *x, 
              double *fvec, double ftol)
  </code></pre>
  
  <p>The "minpack_func_mn" symbol is a typedef for a pointer to a function, defined as:</p>
  
  <pre><code>typedef int (*minpack_func_mn)(void *p, int m, int n, const double *x, 
                double *fvec, int iflag );
  </code></pre>
  
  <p>I want to call the "lmdif" function with a pointer to a function which is a member of a class I created, and here is the declaration of this class function:</p>
  
  <pre><code>int LT_Calibrator::fcn(void *p, int m, int n, const double *x, 
                         double *fvec,int iflag)
  </code></pre>
  
  <p>I am calling a global function like this:</p>
  
  <pre><code>info=lmdif(&amp;LT_Calibrator::fcn, 0, m, n, x, fvec, ftol)
  </code></pre>
  
  <p>Unfortunately, I get a compiler error, which says:
  "error C2664: 'lmdif' : cannot convert parameter 1 from 'int (__thiscall LT_Calibrator::* )(void *,int,int,const double *,double *,int)' to 'minpack_func_mn'
  1>        There is no context in which this conversion is possible"</p>
  
  <p>Is there any way to solve that problem?</p>