Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54024 - in trunk: boost/functional/hash/detail libs/functional/hash/test
From: daniel_james_at_[hidden]
Date: 2009-06-17 17:22:50


Author: danieljames
Date: 2009-06-17 17:22:49 EDT (Wed, 17 Jun 2009)
New Revision: 54024
URL: http://svn.boost.org/trac/boost/changeset/54024

Log:
Put the minimum amount of implementation in the same namespace as the 'using namespace' directives in order to avoid Visual C++ 8 bug.
Added:
   trunk/libs/functional/hash/test/namespace_fail_test.cpp (contents, props changed)
Text files modified:
   trunk/boost/functional/hash/detail/float_functions.hpp | 66 ++++++++++++++++++++-------------------
   trunk/libs/functional/hash/test/Jamfile.v2 | 1
   2 files changed, 35 insertions(+), 32 deletions(-)

Modified: trunk/boost/functional/hash/detail/float_functions.hpp
==============================================================================
--- trunk/boost/functional/hash/detail/float_functions.hpp (original)
+++ trunk/boost/functional/hash/detail/float_functions.hpp 2009-06-17 17:22:49 EDT (Wed, 17 Jun 2009)
@@ -119,43 +119,45 @@
                     sizeof(float_type(c99_func(x,y))) \
                         == sizeof(is<type1>)); \
             }; \
+ } \
                                                                         \
- template <bool x> \
- struct call_c99 : \
- boost::hash_detail::call_##cpp_func<double> {}; \
- \
- template <> \
- struct call_c99<true> { \
- typedef type1 float_type; \
- \
- template <typename T> \
- inline type1 operator()(type1 a, T b) const \
- { \
- return c99_func(a, b); \
- } \
- }; \
+ template <bool x> \
+ struct call_c99_##c99_func : \
+ boost::hash_detail::call_##cpp_func<double> {}; \
                                                                         \
- template <bool x> \
- struct call_cpp : \
- call_c99< \
- ::boost::hash_detail::c99_func##_detect::check::c99 \
- > {}; \
- \
- template <> \
- struct call_cpp<true> { \
- typedef type1 float_type; \
- \
- template <typename T> \
- inline type1 operator()(type1 a, T b) const \
- { \
- return cpp_func(a, b); \
- } \
- }; \
- } \
+ template <> \
+ struct call_c99_##c99_func<true> { \
+ typedef type1 float_type; \
+ \
+ template <typename T> \
+ inline type1 operator()(type1 a, T b) const \
+ { \
+ using namespace std; \
+ return c99_func(a, b); \
+ } \
+ }; \
+ \
+ template <bool x> \
+ struct call_cpp_##c99_func : \
+ call_c99_##c99_func< \
+ ::boost::hash_detail::c99_func##_detect::check::c99 \
+ > {}; \
+ \
+ template <> \
+ struct call_cpp_##c99_func<true> { \
+ typedef type1 float_type; \
+ \
+ template <typename T> \
+ inline type1 operator()(type1 a, T b) const \
+ { \
+ using namespace std; \
+ return cpp_func(a, b); \
+ } \
+ }; \
                                                                         \
         template <> \
         struct call_##cpp_func<type1> : \
- c99_func##_detect::call_cpp< \
+ call_cpp_##c99_func< \
                 ::boost::hash_detail::c99_func##_detect::check::cpp \
> {}; \
     } \

Modified: trunk/libs/functional/hash/test/Jamfile.v2
==============================================================================
--- trunk/libs/functional/hash/test/Jamfile.v2 (original)
+++ trunk/libs/functional/hash/test/Jamfile.v2 2009-06-17 17:22:49 EDT (Wed, 17 Jun 2009)
@@ -38,6 +38,7 @@
         [ run link_ext_test.cpp link_no_ext_test.cpp ]
         [ run container_fwd_test.cpp ]
         [ compile-fail hash_no_ext_fail_test.cpp ]
+ [ compile-fail namespace_fail_test.cpp ]
         [ run hash_no_ext_macro_1.cpp ]
         [ run hash_no_ext_macro_2.cpp ]
     ;

Added: trunk/libs/functional/hash/test/namespace_fail_test.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/functional/hash/test/namespace_fail_test.cpp 2009-06-17 17:22:49 EDT (Wed, 17 Jun 2009)
@@ -0,0 +1,6 @@
+#include <list>
+#include <boost/functional/hash/detail/float_functions.hpp>
+
+typedef list<int> foo;
+
+int main() {}
\ No newline at end of file


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk