I would like to use const to define a TF1 based on a real function.
But when I use the following construct:
//prototype for my Gamma.
double gammaDistribution(const double *yVar, const double gammaPar[]);
//This line has compiler problems.
TF1 *gammaDist=new TF1(“Gamma_Distribution”,gammaDistribution,-2.,10.,4);
I get the following compiler error:
“call of overloaded `TF1(const char[19], double (&)(const double*, const double*),double, double, int)’ is ambiguous.”
But I get no compiler error if I remove the "const"s as I’ve done below.
//prototype
double gammaDistribution( double *yVar, double gammaPar[]);
//This line now compilers.
TF1 *gammaDist=new TF1(“Gamma_Distribution”,gammaDistribution,-2.,10.,4);
I would like to protect the arguments passed to gammaDistribution with
the const qualifier.
Can I do this?
Thanks!