Opened 10 years ago

Closed 10 years ago

#7470 closed Bugs (fixed)

Functional `using namespace std` causing compilation error with icpc -std=c++0x

Reported by: anonymous Owned by: Daniel James
Milestone: To Be Determined Component: hash
Version: Boost 1.52.0 Severity: Problem
Keywords: Cc:

Description

The following two files, boost/functional/hash/detail/float_functions.hpp boost/functional/hash/detail/hash_float.hpp

Contains using namespace std, which can cause problems when compiled with icpc -std=c++11. For example,

#include <boost/thread.hpp>
int main () {}

which will use and instance float_hash_value in boost/functional/hash/detail/hash_float.hpp will emit an overload error about fpclassify is ambitious, as both std::fpclassify and ::fpclassify are perfect match. (tested on Ubuntu 12.04 with icpc 13). This is due to the fact that intel compilers supply its own math.h header and use its own optimized math functions instead of system headers. Change the directive to using std::fpclassify solve the issue .

Change History (5)

comment:1 by Marshall Clow, 10 years ago

(In [81122]) Narrower 'using'; Refs #7470

comment:2 by Daniel James, 10 years ago

Component: functionalhash
Owner: changed from No-Maintainer to Daniel James
Severity: ShowstopperProblem
Status: newassigned

That'll break any libraries which don't have std::fpclassify. It also won't work as it's only one of the two headers, and if the other one is changed it will break the mechanism for detecting which floating point functions are available. It was written that way for a reason.

comment:3 by Daniel James, 10 years ago

(In [81124]) Hash: Revert r81122. Refs #7470.

I'll get back to this later, it probably requires compiler specific changes.

comment:4 by Christian Godenschwager <christian.godenschwager@…>, 10 years ago

Any news on this one? A Boost 1.53.0 with icpc 13.0 & C++11 support would be highly appreciated.

comment:5 by Daniel James, 10 years ago

Resolution: fixed
Status: assignedclosed

This should have been fixed in trunk in r81677 and release in r81920.

Note: See TracTickets for help on using tickets.