Re: Pointer-to-member operator and me

Paolo Calafiura (PCalafiura@lbl.gov)
Wed, 12 Aug 1998 09:57:37 -0700


Hi Nick,
I am probably missing the point here, and in this case sorry for the
waste of bandwidth. Anyway, if you are allowed to modify the signature
of Random::User, as I understand from your message
>
> where I defined Random::User(float a,float b, int n, float (*f)(float))
>
you could try, as a workaround, to make it something like
Random::User(float a,float b, int n, FloatFunction&)

where FloatFunction is your interpreted function embedded in an object

class FloatFunction {
private:
//function initial values, if any (e.g. the 25 in your example)
public:
FloatFunction(){};
//any constructor that ser the function initial values, if needed
float operator()(float x) {return (x*x-2*x+25);}
}
I guess that CINT will not complain about it.

-- 
Paolo Calafiura  
-------------------------------------------------------------------
|   Lawrence Berkeley National Lab   |    NERSC group             |
|   MS 50E 124                       |    office 50E 1519         |
|   1 Cyclotron Rd.                  |    phone 1-510-486-6717    |
|   Berkeley, CA 94720 U.S.          |    fax   1-510-486-4004    |
-------------------------------------------------------------------