Opened 12 years ago

Closed 12 years ago

#4515 closed Patches (fixed)

[math] regression test failure on GCC 4.5 in c++0x mode

Reported by: Richard Webb <richard.webb@…> Owned by: John Maddock
Milestone: Boost 1.44.0 Component: math
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:

Description

When running the math regression tests in Mingw 4.5.0 in C++0x mode, i get some failures due to ambiguities between functions in boost::math and std::. e.g.

http://tinyurl.com/2blmq3l http://tinyurl.com/26yevqq

qualifying the calls with boost::math allows the tests to compile.

Attachments (1)

math.diff (5.0 KB ) - added by Richard Webb <richard.webb@…> 12 years ago.

Download all attachments as: .zip

Change History (3)

by Richard Webb <richard.webb@…>, 12 years ago

Attachment: math.diff added

comment:1 by Paul A. Bristow, 12 years ago

Your fix is fine, and may be best for some applications, but we feel it reads verbosely.

So we have decided to recommend a different way in our examples.

We recommend *NOT* "using namespace anything;" std, boost::math ...

but to qualify each distribution used after the

#include <boost/math/my_distribution>

like

"using boost::math::my_distribution;"

(and "using std::cout; ..." if you wish - worthwhile clutter reduction if there are lots of calls to cout, as is common in cpp source files, but calls are less common in .hpp include files.)

This can be done globally or locally in source .cpp files, but should be only locally in .hpp include files.

All our examples will now follow this recommendation.

comment:2 by John Maddock, 12 years ago

Resolution: fixed
Status: newclosed

Closing down, this should now be fixed.

Note: See TracTickets for help on using tickets.