This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

problems using gsl routines in C++ objects


Hi there,

I intend to pass a member function of an instance of some class X to a 
gsl integration routine, which
requires a pointer of "double (*)(double , void *)" type. I have tried 
various things
such as passing "this->function" or even explicitely casting "double 
(X::*)" to "double (*)",
but I either get comilation errors or the compiler automatically 
converts "double (X::*)" to
"double (*)". in that case when the function is called it is NOT the 
function belonging to
the actual instance of X but rather a function "instantiated" without a 
parental object, thereby
losing all information of the object's parameters.

I do see certain workarounds for this problem but if anyone has a 
"clean" solution at hand
I'd be grateful!

cheers,

daniel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]