forked from boostorg/container_hash
Put the minimum amount of implementation in the same namespace as the 'using namespace' directives in order to avoid Visual C++ 8 bug.
[SVN r54024]
This commit is contained in:
@@ -119,43 +119,45 @@ namespace boost { \
|
|||||||
sizeof(float_type(c99_func(x,y))) \
|
sizeof(float_type(c99_func(x,y))) \
|
||||||
== sizeof(is<type1>)); \
|
== sizeof(is<type1>)); \
|
||||||
}; \
|
}; \
|
||||||
|
} \
|
||||||
\
|
\
|
||||||
template <bool x> \
|
template <bool x> \
|
||||||
struct call_c99 : \
|
struct call_c99_##c99_func : \
|
||||||
boost::hash_detail::call_##cpp_func<double> {}; \
|
boost::hash_detail::call_##cpp_func<double> {}; \
|
||||||
\
|
\
|
||||||
template <> \
|
template <> \
|
||||||
struct call_c99<true> { \
|
struct call_c99_##c99_func<true> { \
|
||||||
typedef type1 float_type; \
|
typedef type1 float_type; \
|
||||||
\
|
\
|
||||||
template <typename T> \
|
template <typename T> \
|
||||||
inline type1 operator()(type1 a, T b) const \
|
inline type1 operator()(type1 a, T b) const \
|
||||||
{ \
|
{ \
|
||||||
|
using namespace std; \
|
||||||
return c99_func(a, b); \
|
return c99_func(a, b); \
|
||||||
} \
|
} \
|
||||||
}; \
|
}; \
|
||||||
\
|
\
|
||||||
template <bool x> \
|
template <bool x> \
|
||||||
struct call_cpp : \
|
struct call_cpp_##c99_func : \
|
||||||
call_c99< \
|
call_c99_##c99_func< \
|
||||||
::boost::hash_detail::c99_func##_detect::check::c99 \
|
::boost::hash_detail::c99_func##_detect::check::c99 \
|
||||||
> {}; \
|
> {}; \
|
||||||
\
|
\
|
||||||
template <> \
|
template <> \
|
||||||
struct call_cpp<true> { \
|
struct call_cpp_##c99_func<true> { \
|
||||||
typedef type1 float_type; \
|
typedef type1 float_type; \
|
||||||
\
|
\
|
||||||
template <typename T> \
|
template <typename T> \
|
||||||
inline type1 operator()(type1 a, T b) const \
|
inline type1 operator()(type1 a, T b) const \
|
||||||
{ \
|
{ \
|
||||||
|
using namespace std; \
|
||||||
return cpp_func(a, b); \
|
return cpp_func(a, b); \
|
||||||
} \
|
} \
|
||||||
}; \
|
}; \
|
||||||
} \
|
|
||||||
\
|
\
|
||||||
template <> \
|
template <> \
|
||||||
struct call_##cpp_func<type1> : \
|
struct call_##cpp_func<type1> : \
|
||||||
c99_func##_detect::call_cpp< \
|
call_cpp_##c99_func< \
|
||||||
::boost::hash_detail::c99_func##_detect::check::cpp \
|
::boost::hash_detail::c99_func##_detect::check::cpp \
|
||||||
> {}; \
|
> {}; \
|
||||||
} \
|
} \
|
||||||
|
@@ -38,6 +38,7 @@ test-suite functional/hash
|
|||||||
[ run link_ext_test.cpp link_no_ext_test.cpp ]
|
[ run link_ext_test.cpp link_no_ext_test.cpp ]
|
||||||
[ run container_fwd_test.cpp ]
|
[ run container_fwd_test.cpp ]
|
||||||
[ compile-fail hash_no_ext_fail_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_1.cpp ]
|
||||||
[ run hash_no_ext_macro_2.cpp ]
|
[ run hash_no_ext_macro_2.cpp ]
|
||||||
;
|
;
|
||||||
|
6
test/namespace_fail_test.cpp
Normal file
6
test/namespace_fail_test.cpp
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#include <list>
|
||||||
|
#include <boost/functional/hash/detail/float_functions.hpp>
|
||||||
|
|
||||||
|
typedef list<int> foo;
|
||||||
|
|
||||||
|
int main() {}
|
Reference in New Issue
Block a user