Boost logo

Boost-Commit :

From: daniel_james_at_[hidden]
Date: 2007-10-12 07:58:35


Author: danieljames
Date: 2007-10-12 07:58:34 EDT (Fri, 12 Oct 2007)
New Revision: 39960
URL: http://svn.boost.org/trac/boost/changeset/39960

Log:
Fix my botched attempt at supporting function pointers on Sun's compilers.
Also, now only applies the workaround to function pointers, non-function
pointers are treated as before. I might need to apply the special case to
member function pointers as well.

Text files modified:
   trunk/boost/functional/hash/hash.hpp | 8 +++++++-
   1 files changed, 7 insertions(+), 1 deletions(-)

Modified: trunk/boost/functional/hash/hash.hpp
==============================================================================
--- trunk/boost/functional/hash/hash.hpp (original)
+++ trunk/boost/functional/hash/hash.hpp 2007-10-12 07:58:34 EDT (Fri, 12 Oct 2007)
@@ -28,6 +28,10 @@
 #include <boost/type_traits/is_const.hpp>
 #endif
 
+#if BOOST_WORKAROUND(__SUNPRO_CC, <= 0x590)
+#include <boost/type_traits/is_function.hpp>
+#endif
+
 namespace boost
 {
     std::size_t hash_value(bool);
@@ -214,7 +218,9 @@
            reinterpret_cast<std::ptrdiff_t>(v));
 #else
         std::size_t x = static_cast<std::size_t>(
- reinterpret_cast<void*>(v));
+ boost::is_function<T>::value ?
+ reinterpret_cast<std::ptrdiff_t>((void*) v) :
+ reinterpret_cast<std::ptrdiff_t>(v));
 #endif
         return x + (x >> 3);
     }


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