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 f637c9e8ce
commit 26dc8abf25

View File

@@ -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 @@ namespace boost
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);
}