diff --git a/include/boost/functional/hash/hash.hpp b/include/boost/functional/hash/hash.hpp index 1ffbc24..e9a9a1c 100644 --- a/include/boost/functional/hash/hash.hpp +++ b/include/boost/functional/hash/hash.hpp @@ -28,10 +28,6 @@ #include #endif -#if BOOST_WORKAROUND(__SUNPRO_CC, <= 0x590) -#include -#endif - namespace boost { std::size_t hash_value(bool); @@ -213,15 +209,9 @@ namespace boost template std::size_t hash_value(T* v) #endif { -#if !BOOST_WORKAROUND(__SUNPRO_CC, <= 0x590) std::size_t x = static_cast( reinterpret_cast(v)); -#else - std::size_t x = static_cast( - boost::is_function::value ? - reinterpret_cast((void*) v) : - reinterpret_cast(v)); -#endif + return x + (x >> 3); } @@ -475,10 +465,14 @@ namespace boost struct hash : public std::unary_function { - std::size_t operator()(T* v) const \ - { \ - return boost::hash_value(v); \ - } \ + std::size_t operator()(T* v) const + { +#if !BOOST_WORKAROUND(__SUNPRO_CC, <= 0x590) + return boost::hash_value(v); +#else + return boost::hash_value(v); +#endif + } }; #else namespace hash_detail @@ -495,7 +489,11 @@ namespace boost { std::size_t operator()(T val) const { +#if !BOOST_WORKAROUND(__SUNPRO_CC, <= 590) return boost::hash_value(val); +#else + return boost::hash_value(val); +#endif } }; };