Boost logo

Boost :

Subject: [boost] math/tools/rational.hpp gcc 3.2 problem
From: Ralf W. Grosse-Kunstleve (rwgk_at_[hidden])
Date: 2009-10-08 12:55:12


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?

Ralf


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk