diff --git a/hash/test/Jamfile.v2 b/hash/test/Jamfile.v2 index ff149a7..c91691f 100644 --- a/hash/test/Jamfile.v2 +++ b/hash/test/Jamfile.v2 @@ -38,6 +38,7 @@ test-suite functional/hash [ 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 ] ; diff --git a/hash/test/namespace_fail_test.cpp b/hash/test/namespace_fail_test.cpp new file mode 100644 index 0000000..2e02d57 --- /dev/null +++ b/hash/test/namespace_fail_test.cpp @@ -0,0 +1,6 @@ +#include +#include + +typedef list foo; + +int main() {} \ No newline at end of file diff --git a/include/boost/functional/hash/detail/float_functions.hpp b/include/boost/functional/hash/detail/float_functions.hpp index 9ec0dd2..f766ec9 100644 --- a/include/boost/functional/hash/detail/float_functions.hpp +++ b/include/boost/functional/hash/detail/float_functions.hpp @@ -118,44 +118,46 @@ namespace boost { \ BOOST_STATIC_CONSTANT(bool, c99 = \ sizeof(float_type(c99_func(x,y))) \ == sizeof(is)); \ - }; \ - \ - template \ - struct call_c99 : \ - boost::hash_detail::call_##cpp_func {}; \ - \ - template <> \ - struct call_c99 { \ - typedef type1 float_type; \ - \ - template \ - inline type1 operator()(type1 a, T b) const \ - { \ - return c99_func(a, b); \ - } \ - }; \ - \ - template \ - struct call_cpp : \ - call_c99< \ - ::boost::hash_detail::c99_func##_detect::check::c99 \ - > {}; \ - \ - template <> \ - struct call_cpp { \ - typedef type1 float_type; \ - \ - template \ - inline type1 operator()(type1 a, T b) const \ - { \ - return cpp_func(a, b); \ - } \ }; \ } \ \ + template \ + struct call_c99_##c99_func : \ + boost::hash_detail::call_##cpp_func {}; \ + \ + template <> \ + struct call_c99_##c99_func { \ + typedef type1 float_type; \ + \ + template \ + inline type1 operator()(type1 a, T b) const \ + { \ + using namespace std; \ + return c99_func(a, b); \ + } \ + }; \ + \ + template \ + struct call_cpp_##c99_func : \ + call_c99_##c99_func< \ + ::boost::hash_detail::c99_func##_detect::check::c99 \ + > {}; \ + \ + template <> \ + struct call_cpp_##c99_func { \ + typedef type1 float_type; \ + \ + template \ + inline type1 operator()(type1 a, T b) const \ + { \ + using namespace std; \ + return cpp_func(a, b); \ + } \ + }; \ + \ template <> \ struct call_##cpp_func : \ - c99_func##_detect::call_cpp< \ + call_cpp_##c99_func< \ ::boost::hash_detail::c99_func##_detect::check::cpp \ > {}; \ } \