mirror of
https://github.com/boostorg/functional.git
synced 2025-08-02 14:04:27 +02:00
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:
@@ -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);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user