Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
2 // Copyright Daniel James 2005-2006. Use, modification, and distribution are
3 // subject to the Boost Software License, Version 1.0. (See accompanying
4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 // Based on Peter Dimov's proposal
7 // http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1756.pdf
10 #if !defined(BOOST_FUNCTIONAL_DETAIL_HASH_FLOAT_HEADER)
11 #define BOOST_FUNCTIONAL_DETAIL_HASH_FLOAT_HEADER
13 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
17 #include <boost/functional/detail/float_functions.hpp>
18 #include <boost/limits.hpp>
19 #include <boost/assert.hpp>
22 // Don't use fpclassify or _fpclass for stlport.
23 #if !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
24 # if defined(__GLIBCPP__) || defined(__GLIBCXX__)
26 # if (defined(__USE_ISOC99) || defined(_GLIBCXX_USE_C99_MATH)) && \
27 !(defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__))
28 # define BOOST_HASH_USE_FPCLASSIFY
30 # elif (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER)
31 // Dinkumware Library, on Visual C++
32 # if defined(BOOST_MSVC)
33 # define BOOST_HASH_USE_FPCLASS
42 inline void hash_float_combine(std::size_t& seed, std::size_t value)
44 seed ^= value + (seed<<6) + (seed>>2);
48 inline std::size_t float_hash_impl(T v)
52 v = boost::hash_detail::call_frexp(v, &exp);
57 std::size_t const length
58 = (std::numeric_limits<T>::digits +
59 std::numeric_limits<int>::digits - 1)
60 / std::numeric_limits<int>::digits;
62 for(std::size_t i = 0; i < length; ++i)
64 v = boost::hash_detail::call_ldexp(v, std::numeric_limits<int>::digits);
65 int const part = static_cast<int>(v);
67 hash_float_combine(seed, part);
70 hash_float_combine(seed, exp);
76 inline std::size_t float_hash_value(T v)
78 #if defined(BOOST_HASH_USE_FPCLASSIFY)
80 switch (fpclassify(v)) {
84 return (std::size_t)(v > 0 ? -1 : -2);
86 return (std::size_t)(-3);
89 return float_hash_impl(v);
94 #elif defined(BOOST_HASH_USE_FPCLASS)
100 return (std::size_t)(-1);
102 return (std::size_t)(-2);
105 return (std::size_t)(-3);
108 return float_hash_impl(v);
111 return float_hash_impl(v);
117 return float_hash_impl(v);