|
Boost : |
Subject: Re: [boost] math/tools/rational.hpp gcc 3.2 problem
From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2009-10-14 07:43:50
> -----Original Message-----
> From: boost-bounces_at_[hidden] [mailto:boost-bounces_at_[hidden]] On
Behalf Of
> Ralf W. Grosse-Kunstleve
> Sent: Thursday, October 08, 2009 5:55 PM
> To: boost_at_[hidden]
> Subject: [boost] math/tools/rational.hpp gcc 3.2 problem
>
> gcc 3.2 doesn't compile this code (works with gcc 3.3 and up):
>
> #include <boost/math/distributions.hpp>
> int
> main()
> {
> boost::math::students_t_distribution<double> dist(1.);
> dist.find_degrees_of_freedom(1.,2.,3.,4.,5.);
> return 0;
> }
>
>
>
> Reduced:
>
> template <unsigned N, class T, class V>
> inline V evaluate_polynomial(const T(&a)[N], const V& val)
> {
> return val * a[0] * static_cast<T>(N);
> }
>
> int
> main()
> {
> double a[3];
> double val;
> double result = evaluate_polynomial(a, val);
> return static_cast<int>(result);
> }
>
>
> dbg2.cpp: In function `int main()':
> dbg2.cpp:12: no matching function for call to `
> evaluate_polynomial(double[3], double&)'
>
>
> Does anyone have an idea for working around the problem?
It looks as though compliance testing was done with Linux GNU C++ 3.4
(performance was done with Cygwin G++ 3.4 - and John Maddock notes that 4.
optimises much better).
So sorry but I don't have any suggestions - apart from using gcc 3.3 or up ;-)
Paul
--- Paul A. Bristow Prizet Farmhouse Kendal, UK LA8 8AB +44 1539 561830, mobile +44 7714330204 pbristow_at_[hidden]
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk