summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '3rdParty/Boost/src/boost/functional/hash/detail')
-rw-r--r--3rdParty/Boost/src/boost/functional/hash/detail/container_fwd_0x.hpp29
-rw-r--r--3rdParty/Boost/src/boost/functional/hash/detail/float_functions.hpp94
-rw-r--r--3rdParty/Boost/src/boost/functional/hash/detail/hash_float.hpp61
-rw-r--r--3rdParty/Boost/src/boost/functional/hash/detail/limits.hpp5
4 files changed, 127 insertions, 62 deletions
diff --git a/3rdParty/Boost/src/boost/functional/hash/detail/container_fwd_0x.hpp b/3rdParty/Boost/src/boost/functional/hash/detail/container_fwd_0x.hpp
deleted file mode 100644
index bed7730..0000000
--- a/3rdParty/Boost/src/boost/functional/hash/detail/container_fwd_0x.hpp
+++ /dev/null
@@ -1,29 +0,0 @@
-
-// Copyright 2012 Daniel James.
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#if !defined(BOOST_DETAIL_CONTAINER_FWD_0X_HPP)
-#define BOOST_DETAIL_CONTAINER_FWD_0X_HPP
-
-#include <boost/detail/container_fwd.hpp>
-
-// std::array
-
-#if !defined(BOOST_NO_CXX11_HDR_ARRAY)
-# include <array>
-#endif
-
-// std::tuple
-
-#if !defined(BOOST_NO_CXX11_HDR_TUPLE)
-# include <tuple>
-#endif
-
-// std::shared_ptr/std::unique_ptr
-
-#if !defined(BOOST_NO_CXX11_HDR_MEMORY)
-# include <memory>
-#endif
-
-#endif
diff --git a/3rdParty/Boost/src/boost/functional/hash/detail/float_functions.hpp b/3rdParty/Boost/src/boost/functional/hash/detail/float_functions.hpp
index ae03ff0..f3db52f 100644
--- a/3rdParty/Boost/src/boost/functional/hash/detail/float_functions.hpp
+++ b/3rdParty/Boost/src/boost/functional/hash/detail/float_functions.hpp
@@ -7,12 +7,100 @@
#define BOOST_FUNCTIONAL_HASH_DETAIL_FLOAT_FUNCTIONS_HPP
#include <boost/config.hpp>
+#if defined(BOOST_HAS_PRAGMA_ONCE)
+#pragma once
+#endif
+
#include <boost/config/no_tr1/cmath.hpp>
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
-# pragma once
+// Set BOOST_HASH_CONFORMANT_FLOATS to 1 for libraries known to have
+// sufficiently good floating point support to not require any
+// workarounds.
+//
+// When set to 0, the library tries to automatically
+// use the best available implementation. This normally works well, but
+// breaks when ambiguities are created by odd namespacing of the functions.
+//
+// Note that if this is set to 0, the library should still take full
+// advantage of the platform's floating point support.
+
+#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
+# define BOOST_HASH_CONFORMANT_FLOATS 0
+#elif defined(__LIBCOMO__)
+# define BOOST_HASH_CONFORMANT_FLOATS 0
+#elif defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER)
+// Rogue Wave library:
+# define BOOST_HASH_CONFORMANT_FLOATS 0
+#elif defined(_LIBCPP_VERSION)
+// libc++
+# define BOOST_HASH_CONFORMANT_FLOATS 1
+#elif defined(__GLIBCPP__) || defined(__GLIBCXX__)
+// GNU libstdc++ 3
+# if defined(__GNUC__) && __GNUC__ >= 4
+# define BOOST_HASH_CONFORMANT_FLOATS 1
+# else
+# define BOOST_HASH_CONFORMANT_FLOATS 0
+# endif
+#elif defined(__STL_CONFIG_H)
+// generic SGI STL
+# define BOOST_HASH_CONFORMANT_FLOATS 0
+#elif defined(__MSL_CPP__)
+// MSL standard lib:
+# define BOOST_HASH_CONFORMANT_FLOATS 0
+#elif defined(__IBMCPP__)
+// VACPP std lib (probably conformant for much earlier version).
+# if __IBMCPP__ >= 1210
+# define BOOST_HASH_CONFORMANT_FLOATS 1
+# else
+# define BOOST_HASH_CONFORMANT_FLOATS 0
+# endif
+#elif defined(MSIPL_COMPILE_H)
+// Modena C++ standard library
+# define BOOST_HASH_CONFORMANT_FLOATS 0
+#elif (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER)
+// Dinkumware Library (this has to appear after any possible replacement libraries):
+# if _CPPLIB_VER >= 405
+# define BOOST_HASH_CONFORMANT_FLOATS 1
+# else
+# define BOOST_HASH_CONFORMANT_FLOATS 0
+# endif
+#else
+# define BOOST_HASH_CONFORMANT_FLOATS 0
#endif
+#if BOOST_HASH_CONFORMANT_FLOATS
+
+// The standard library is known to be compliant, so don't use the
+// configuration mechanism.
+
+namespace boost {
+ namespace hash_detail {
+ template <typename Float>
+ struct call_ldexp {
+ typedef Float float_type;
+ inline Float operator()(Float x, int y) const {
+ return std::ldexp(x, y);
+ }
+ };
+
+ template <typename Float>
+ struct call_frexp {
+ typedef Float float_type;
+ inline Float operator()(Float x, int* y) const {
+ return std::frexp(x, y);
+ }
+ };
+
+ template <typename Float>
+ struct select_hash_type
+ {
+ typedef Float type;
+ };
+ }
+}
+
+#else // BOOST_HASH_CONFORMANT_FLOATS == 0
+
// The C++ standard requires that the C float functions are overloarded
// for float, double and long double in the std namespace, but some of the older
// library implementations don't support this. On some that don't, the C99
@@ -243,4 +331,6 @@ namespace boost
}
}
+#endif // BOOST_HASH_CONFORMANT_FLOATS
+
#endif
diff --git a/3rdParty/Boost/src/boost/functional/hash/detail/hash_float.hpp b/3rdParty/Boost/src/boost/functional/hash/detail/hash_float.hpp
index 3edc6ab..ee0ee87 100644
--- a/3rdParty/Boost/src/boost/functional/hash/detail/hash_float.hpp
+++ b/3rdParty/Boost/src/boost/functional/hash/detail/hash_float.hpp
@@ -6,11 +6,11 @@
#if !defined(BOOST_FUNCTIONAL_HASH_DETAIL_HASH_FLOAT_HEADER)
#define BOOST_FUNCTIONAL_HASH_DETAIL_HASH_FLOAT_HEADER
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
-# pragma once
+#include <boost/config.hpp>
+#if defined(BOOST_HAS_PRAGMA_ONCE)
+#pragma once
#endif
-#include <boost/config.hpp>
#include <boost/functional/hash/detail/float_functions.hpp>
#include <boost/functional/hash/detail/limits.hpp>
#include <boost/utility/enable_if.hpp>
@@ -73,7 +73,9 @@ namespace boost
ptr += sizeof(std::size_t);
while(length >= sizeof(std::size_t)) {
- hash_float_combine(seed, *(std::size_t*) ptr);
+ std::size_t buffer = 0;
+ std::memcpy(&buffer, ptr, sizeof(std::size_t));
+ hash_float_combine(seed, buffer);
length -= sizeof(std::size_t);
ptr += sizeof(std::size_t);
}
@@ -88,15 +90,21 @@ namespace boost
return seed;
}
+ template <typename Float, unsigned digits, unsigned max_exponent>
+ struct enable_binary_hash
+ {
+ BOOST_STATIC_CONSTANT(bool, value =
+ std::numeric_limits<Float>::is_iec559 &&
+ std::numeric_limits<Float>::digits == digits &&
+ std::numeric_limits<Float>::radix == 2 &&
+ std::numeric_limits<Float>::max_exponent == max_exponent);
+ };
+
template <typename Float>
inline std::size_t float_hash_impl(Float v,
BOOST_DEDUCED_TYPENAME boost::enable_if_c<
- std::numeric_limits<Float>::is_iec559 &&
- std::numeric_limits<Float>::digits == 24 &&
- std::numeric_limits<Float>::radix == 2 &&
- std::numeric_limits<Float>::max_exponent == 128,
- int>::type
- )
+ enable_binary_hash<Float, 24, 128>::value,
+ std::size_t>::type)
{
return hash_binary((char*) &v, 4);
}
@@ -105,12 +113,8 @@ namespace boost
template <typename Float>
inline std::size_t float_hash_impl(Float v,
BOOST_DEDUCED_TYPENAME boost::enable_if_c<
- std::numeric_limits<Float>::is_iec559 &&
- std::numeric_limits<Float>::digits == 53 &&
- std::numeric_limits<Float>::radix == 2 &&
- std::numeric_limits<Float>::max_exponent == 1024,
- int>::type
- )
+ enable_binary_hash<Float, 53, 1024>::value,
+ std::size_t>::type)
{
return hash_binary((char*) &v, 8);
}
@@ -118,12 +122,8 @@ namespace boost
template <typename Float>
inline std::size_t float_hash_impl(Float v,
BOOST_DEDUCED_TYPENAME boost::enable_if_c<
- std::numeric_limits<Float>::is_iec559 &&
- std::numeric_limits<Float>::digits == 64 &&
- std::numeric_limits<Float>::radix == 2 &&
- std::numeric_limits<Float>::max_exponent == 16384,
- int>::type
- )
+ enable_binary_hash<Float, 64, 16384>::value,
+ std::size_t>::type)
{
return hash_binary((char*) &v, 10);
}
@@ -131,12 +131,8 @@ namespace boost
template <typename Float>
inline std::size_t float_hash_impl(Float v,
BOOST_DEDUCED_TYPENAME boost::enable_if_c<
- std::numeric_limits<Float>::is_iec559 &&
- std::numeric_limits<Float>::digits == 113 &&
- std::numeric_limits<Float>::radix == 2 &&
- std::numeric_limits<Float>::max_exponent == 16384,
- int>::type
- )
+ enable_binary_hash<Float, 113, 16384>::value,
+ std::size_t>::type)
{
return hash_binary((char*) &v, 16);
}
@@ -210,8 +206,15 @@ namespace boost
template <class T>
inline std::size_t float_hash_value(T v)
{
+#if defined(fpclassify)
+ switch (fpclassify(v))
+#elif BOOST_HASH_CONFORMANT_FLOATS
+ switch (std::fpclassify(v))
+#else
using namespace std;
- switch (fpclassify(v)) {
+ switch (fpclassify(v))
+#endif
+ {
case FP_ZERO:
return 0;
case FP_INFINITE:
diff --git a/3rdParty/Boost/src/boost/functional/hash/detail/limits.hpp b/3rdParty/Boost/src/boost/functional/hash/detail/limits.hpp
index f5b520e..4a971a6 100644
--- a/3rdParty/Boost/src/boost/functional/hash/detail/limits.hpp
+++ b/3rdParty/Boost/src/boost/functional/hash/detail/limits.hpp
@@ -9,8 +9,9 @@
#if !defined(BOOST_FUNCTIONAL_HASH_DETAIL_LIMITS_HEADER)
#define BOOST_FUNCTIONAL_HASH_DETAIL_LIMITS_HEADER
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
-# pragma once
+#include <boost/config.hpp>
+#if defined(BOOST_HAS_PRAGMA_ONCE)
+#pragma once
#endif
#include <boost/limits.hpp>