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.


[SVN r39960]
This commit is contained in:
Daniel James
2007-10-12 11:58:34 +00:00
parent 4f3f3237db
commit cd2d453735

View File

@@ -28,6 +28,10 @@
#include <boost/type_traits/is_const.hpp> #include <boost/type_traits/is_const.hpp>
#endif #endif
#if BOOST_WORKAROUND(__SUNPRO_CC, <= 0x590)
#include <boost/type_traits/is_function.hpp>
#endif
namespace boost namespace boost
{ {
std::size_t hash_value(bool); std::size_t hash_value(bool);
@@ -214,7 +218,9 @@ namespace boost
reinterpret_cast<std::ptrdiff_t>(v)); reinterpret_cast<std::ptrdiff_t>(v));
#else #else
std::size_t x = static_cast<std::size_t>( 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 #endif
return x + (x >> 3); return x + (x >> 3);
} }