Boost logo

Boost Testing :

From: John Maddock (john_at_[hidden])
Date: 2006-01-11 08:03:29

> The way this library is constructed seems to be that in general if you
> use the C++ 'c*' equivalent of a C '*.h' header, all the functions get
> promoted into the std namespace. This is not the first time we have
> encountered this problem.

Just to clarify: if the symbol is part of the C++ std then it should be in
namespace std only when you include the <c*> header. However, symbols that
are not part of the C++ std (log1p, expm1 etc) should *never* be in
namespace std, at least according to the letter of the std.

> So it's likely to be one simple stupid factor at the heart of it all.
> :-)

Yep, 'fraid so.

> Thanks for the hints. I will investigate.

On second thoughts, don't bother debugging (unless you really want to), just
run the following short program and I'll compare the output with a "good"
platform :-)


#include <boost/math/complex.hpp>
#include <iostream>
#include <iomanip>

int main()
double x = -1;
double y;
static const double interval = 2.0/128.0;
for(y = -1; y <= 1; y += interval)
// acos:
std::complex<double> val(x, y);
std::complex<double> result1 = boost::math::acos(val);
std::complex<double> result2 = std::cos(result1);
std::cout << val << " " << result1 << " " << result2 << std::endl;
return 0;

Boost-testing list run by mbergal at