Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#3207 closed Bugs (fixed)

cannot use both students_t.hpp and unit_test.hpp

Reported by: Martin Ankerl <martin.ankerl@…> Owned by: John Maddock
Milestone: Boost 1.40.0 Component: math
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:

Description

This code does not compile:

#include <boost/test/included/unit_test.hpp>
#include <boost/math/distributions/students_t.hpp>

static void log_test()
{
  boost::math::students_t dist(0.5);
  double p = boost::math::cdf(dist, 1.0);
}

I get this error message:

d:\dev\trunk\lib_boost\inc\boost\math\special_functions\log1p.hpp(407) : error C2882: 'log' : illegal use of namespace identifier in expression

it can be fixed by changing the offending line

return log(u)*(x/(u-1.0));

into

return ::log(u)*(x/(u-1.0));

but I am not sure if this is a good fix. I have tried this on an older version we are working with, and on the current svn trunk.

Change History (2)

comment:1 by John Maddock, 13 years ago

Resolution: fixed
Status: newclosed

(In [54284]) Fix lookup ambiguity. Fixes #3207.

comment:2 by John Maddock, 13 years ago

(In [54285]) Fix lookup ambiguity. Fixes #3207.

Note: See TracTickets for help on using tickets.