On 2003.12.23 07:10, amar singh wrote:
> I think the problem is due to the signature of the function I pass in
> the operator(). I had earlier used as following :
>
> double Fn(double x)
> {
> return x^2;
> }
>
> double val = KronrodIntegral(0.1,1000)(Fn,0,5);
>
> This gave the above compiling error in MS VC++, while it works in
> Borland C++.
>
> Writing it as
> double val = KronrodIntegral(0.1,1000)(std::ptr_fun<double,double>
> (Fn),0,5);
>
> solves the compiling error problem in MS VC++.
>
> Don't know how it works though! (copied the usage from test-suite!)
Amar,
the error you had wasn't an error in your code--it was an
internal compiler error, meaning that VC++ got confused by something
and could not even tell you why. In short, you triggered a bug in the
compiler. The compiler documentation is not much help either--it merely
suggests to rewrite your (legal) code in a different way. In short,
they don't know why the compiler goes bang and hope that rewriting the
code will cause the compiler to do something different.
Sorry if I cannot be of much more help,
Luigi