This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
problems using gsl routines in C++ objects
- From: Daniel Rohe <d dot rohe at fkf dot mpg dot de>
- To: gsl list <gsl-discuss at sources dot redhat dot com>
- Date: Tue, 26 Feb 2002 17:55:14 +0100
- Subject: 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