Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r49661 - in trunk: boost/detail boost/functional/detail boost/functional/hash boost/functional/hash/detail libs/functional/hash/doc libs/functional/hash/test
From: daniel_james_at_[hidden]
Date: 2008-11-09 07:03:46


Author: danieljames
Date: 2008-11-09 07:03:45 EST (Sun, 09 Nov 2008)
New Revision: 49661
URL: http://svn.boost.org/trac/boost/changeset/49661

Log:
Move hash detail headers out of boost/functional/detail.
Added:
   trunk/boost/detail/container_fwd.hpp (props changed)
      - copied unchanged from r49648, /trunk/boost/functional/detail/container_fwd.hpp
   trunk/boost/functional/hash/detail/
   trunk/boost/functional/hash/detail/float_functions.hpp (contents, props changed)
      - copied, changed from r49648, /trunk/boost/functional/detail/float_functions.hpp
   trunk/boost/functional/hash/detail/hash_float.hpp (contents, props changed)
      - copied, changed from r49648, /trunk/boost/functional/detail/hash_float.hpp
Removed:
   trunk/boost/functional/detail/container_fwd.hpp
   trunk/boost/functional/detail/float_functions.hpp
   trunk/boost/functional/detail/hash_float.hpp
Text files modified:
   trunk/boost/functional/hash/detail/float_functions.hpp | 4 ++--
   trunk/boost/functional/hash/detail/hash_float.hpp | 6 +++---
   trunk/boost/functional/hash/hash.hpp | 4 ++--
   trunk/libs/functional/hash/doc/changes.qbk | 4 ++++
   trunk/libs/functional/hash/test/container_fwd_test.cpp | 2 +-
   5 files changed, 12 insertions(+), 8 deletions(-)

Deleted: trunk/boost/functional/detail/container_fwd.hpp
==============================================================================
--- trunk/boost/functional/detail/container_fwd.hpp 2008-11-09 07:03:45 EST (Sun, 09 Nov 2008)
+++ (empty file)
@@ -1,95 +0,0 @@
-
-// Copyright 2005-2008 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_HPP)
-#define BOOST_DETAIL_CONTAINER_FWD_HPP
-
-#include <boost/config.hpp>
-#include <boost/detail/workaround.hpp>
-
-#if BOOST_WORKAROUND(__GNUC__, < 3) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
-#define BOOST_HASH_CHAR_TRAITS string_char_traits
-#else
-#define BOOST_HASH_CHAR_TRAITS char_traits
-#endif
-
-#if (defined(__GLIBCXX__) && defined(_GLIBCXX_DEBUG)) \
- || BOOST_WORKAROUND(__BORLANDC__, > 0x551) \
- || BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x842)) \
- || (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))
-
-#include <deque>
-#include <list>
-#include <vector>
-#include <map>
-#include <set>
-#include <bitset>
-#include <string>
-#include <complex>
-
-#else
-
-#include <cstddef>
-
-#if !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) && \
- defined(__STL_CONFIG_H)
-
-#define BOOST_CONTAINER_FWD_BAD_BITSET
-
-#if !defined(__STL_NON_TYPE_TMPL_PARAM_BUG)
-#define BOOST_CONTAINER_FWD_BAD_DEQUE
-#endif
-
-#endif
-
-#if defined(BOOST_CONTAINER_FWD_BAD_DEQUE)
-#include <deque>
-#endif
-
-#if defined(BOOST_CONTAINER_FWD_BAD_BITSET)
-#include <bitset>
-#endif
-
-#if defined(BOOST_MSVC)
-#pragma warning(push)
-#pragma warning(disable:4099) // struct/class mismatch in fwd declarations
-#endif
-
-namespace std
-{
- template <class T> class allocator;
- template <class charT, class traits, class Allocator> class basic_string;
- template <class charT> struct BOOST_HASH_CHAR_TRAITS;
- template <class T> class complex;
-}
-
-// gcc 3.4 and greater
-namespace std
-{
-#if !defined(BOOST_CONTAINER_FWD_BAD_DEQUE)
- template <class T, class Allocator> class deque;
-#endif
-
- template <class T, class Allocator> class list;
- template <class T, class Allocator> class vector;
- template <class Key, class T, class Compare, class Allocator> class map;
- template <class Key, class T, class Compare, class Allocator>
- class multimap;
- template <class Key, class Compare, class Allocator> class set;
- template <class Key, class Compare, class Allocator> class multiset;
-
-#if !defined(BOOST_CONTAINER_FWD_BAD_BITSET)
- template <size_t N> class bitset;
-#endif
- template <class T1, class T2> struct pair;
-}
-
-#if defined(BOOST_MSVC)
-#pragma warning(pop)
-#endif
-
-#endif
-
-#endif

Deleted: trunk/boost/functional/detail/float_functions.hpp
==============================================================================
--- trunk/boost/functional/detail/float_functions.hpp 2008-11-09 07:03:45 EST (Sun, 09 Nov 2008)
+++ (empty file)
@@ -1,158 +0,0 @@
-
-// Copyright 2005-2008 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_FUNCTIONAL_DETAIL_FLOAT_FUNCTIONS_HPP)
-#define BOOST_FUNCTIONAL_DETAIL_FLOAT_FUNCTIONS_HPP
-
-#include <boost/config/no_tr1/cmath.hpp>
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
-# pragma once
-#endif
-
-// 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
-// float functions (frexpf, frexpl, etc.) are available.
-//
-// Some of this is based on guess work. If I don't know any better I assume that
-// the standard C++ overloaded functions are available. If they're not then this
-// means that the argument is cast to a double and back, which is inefficient
-// and will give pretty bad results for long doubles - so if you know better
-// let me know.
-
-// STLport:
-#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
-# if (defined(__GNUC__) && __GNUC__ < 3 && (defined(linux) || defined(__linux) || defined(__linux__))) || defined(__DMC__)
-# define BOOST_HASH_USE_C99_FLOAT_FUNCS
-# elif defined(BOOST_MSVC) && BOOST_MSVC < 1300
-# define BOOST_HASH_USE_C99_FLOAT_FUNCS
-# else
-# define BOOST_HASH_USE_OVERLOAD_FLOAT_FUNCS
-# endif
-
-// Roguewave:
-//
-// On borland 5.51, with roguewave 2.1.1 the standard C++ overloads aren't
-// defined, but for the same version of roguewave on sunpro they are.
-#elif defined(_RWSTD_VER)
-# if defined(__BORLANDC__)
-# define BOOST_HASH_USE_C99_FLOAT_FUNCS
-# define BOOST_HASH_C99_NO_FLOAT_FUNCS
-# elif defined(__DECCXX)
-# define BOOST_HASH_USE_C99_FLOAT_FUNCS
-# else
-# define BOOST_HASH_USE_OVERLOAD_FLOAT_FUNCS
-# endif
-
-// libstdc++ (gcc 3.0 onwards, I think)
-#elif defined(__GLIBCPP__) || defined(__GLIBCXX__)
-# define BOOST_HASH_USE_OVERLOAD_FLOAT_FUNCS
-
-// SGI:
-#elif defined(__STL_CONFIG_H)
-# if defined(linux) || defined(__linux) || defined(__linux__)
-# define BOOST_HASH_USE_C99_FLOAT_FUNCS
-# else
-# define BOOST_HASH_USE_OVERLOAD_FLOAT_FUNCS
-# endif
-
-// Dinkumware.
-#elif (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER)
-// Some versions of Visual C++ don't seem to have the C++ overloads but they
-// all seem to have the c99 float overloads
-# if defined(BOOST_MSVC)
-# define BOOST_HASH_USE_C99_FLOAT_FUNCS
-// On other platforms the C++ overloads seem to have been introduced sometime
-// before 402.
-# elif defined(_CPPLIB_VER) && (_CPPLIB_VER >= 402)
-# define BOOST_HASH_USE_OVERLOAD_FLOAT_FUNCS
-# else
-# define BOOST_HASH_USE_C99_FLOAT_FUNCS
-# endif
-
-// Digital Mars
-#elif defined(__DMC__)
-# define BOOST_HASH_USE_C99_FLOAT_FUNCS
-
-// Use overloaded float functions by default.
-#else
-# define BOOST_HASH_USE_OVERLOAD_FLOAT_FUNCS
-#endif
-
-namespace boost
-{
- namespace hash_detail
- {
-
- inline float call_ldexp(float v, int exp)
- {
- using namespace std;
-#if defined(BOOST_HASH_USE_OVERLOAD_FLOAT_FUNCS) || \
- defined(BOOST_HASH_C99_NO_FLOAT_FUNCS)
- return ldexp(v, exp);
-#else
- return ldexpf(v, exp);
-#endif
- }
-
- inline double call_ldexp(double v, int exp)
- {
- using namespace std;
- return ldexp(v, exp);
- }
-
- inline long double call_ldexp(long double v, int exp)
- {
- using namespace std;
-#if defined(BOOST_HASH_USE_OVERLOAD_FLOAT_FUNCS)
- return ldexp(v, exp);
-#else
- return ldexpl(v, exp);
-#endif
- }
-
- inline float call_frexp(float v, int* exp)
- {
- using namespace std;
-#if defined(BOOST_HASH_USE_OVERLOAD_FLOAT_FUNCS) || \
- defined(BOOST_HASH_C99_NO_FLOAT_FUNCS)
- return frexp(v, exp);
-#else
- return frexpf(v, exp);
-#endif
- }
-
- inline double call_frexp(double v, int* exp)
- {
- using namespace std;
- return frexp(v, exp);
- }
-
- inline long double call_frexp(long double v, int* exp)
- {
- using namespace std;
-#if defined(BOOST_HASH_USE_OVERLOAD_FLOAT_FUNCS)
- return frexp(v, exp);
-#else
- return frexpl(v, exp);
-#endif
- }
- }
-}
-
-#if defined(BOOST_HASH_USE_C99_FLOAT_FUNCS)
-#undef BOOST_HASH_USE_C99_FLOAT_FUNCS
-#endif
-
-#if defined(BOOST_HASH_USE_OVERLOAD_FLOAT_FUNCS)
-#undef BOOST_HASH_USE_OVERLOAD_FLOAT_FUNCS
-#endif
-
-#if defined(BOOST_HASH_C99_NO_FLOAT_FUNCS)
-#undef BOOST_HASH_C99_NO_FLOAT_FUNCS
-#endif
-
-#endif

Deleted: trunk/boost/functional/detail/hash_float.hpp
==============================================================================
--- trunk/boost/functional/detail/hash_float.hpp 2008-11-09 07:03:45 EST (Sun, 09 Nov 2008)
+++ (empty file)
@@ -1,201 +0,0 @@
-
-// Copyright 2005-2008 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)
-
-// Based on Peter Dimov's proposal
-// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1756.pdf
-// issue 6.18.
-
-#if !defined(BOOST_FUNCTIONAL_DETAIL_HASH_FLOAT_HEADER)
-#define BOOST_FUNCTIONAL_DETAIL_HASH_FLOAT_HEADER
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
-# pragma once
-#endif
-
-#if defined(BOOST_MSVC)
-#pragma warning(push)
-#if BOOST_MSVC >= 1400
-#pragma warning(disable:6294) // Ill-defined for-loop: initial condition does
- // not satisfy test. Loop body not executed
-#endif
-#endif
-
-#include <boost/functional/detail/float_functions.hpp>
-#include <boost/integer/static_log2.hpp>
-#include <boost/cstdint.hpp>
-#include <boost/limits.hpp>
-#include <boost/assert.hpp>
-
-// Select implementation for the current platform.
-
-// Cygwn
-#if defined(__CYGWIN__)
-# if defined(__i386__) || defined(_M_IX86)
-# define BOOST_HASH_USE_x86_BINARY_HASH
-# endif
-
-// STLport
-#elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
-// fpclassify aren't good enough on STLport.
-
-// GNU libstdc++ 3
-#elif defined(__GLIBCPP__) || defined(__GLIBCXX__)
-# if (defined(__USE_ISOC99) || defined(_GLIBCXX_USE_C99_MATH)) && \
- !(defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__))
-# define BOOST_HASH_USE_FPCLASSIFY
-# endif
-
-// Dinkumware Library, on Visual C++
-#elif (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER)
-
-// Not using _fpclass because it is only available for double.
-
-#endif
-
-// On OpenBSD, numeric_limits is not reliable for long doubles, but
-// the macros defined in <float.h> are.
-
-#if defined(__OpenBSD__)
-#include <float.h>
-#endif
-
-namespace boost
-{
- namespace hash_detail
- {
- template <class T>
- struct limits : std::numeric_limits<T> {};
-
-#if defined(__OpenBSD__)
- template <>
- struct limits<long double>
- : std::numeric_limits<long double>
- {
- static long double epsilon() {
- return LDBL_EPSILON;
- }
-
- static long double (max)() {
- return LDBL_MAX;
- }
-
- static long double (min)() {
- return LDBL_MIN;
- }
-
- BOOST_STATIC_CONSTANT(int, digits = LDBL_MANT_DIG);
- BOOST_STATIC_CONSTANT(int, max_exponent = LDBL_MAX_EXP);
- BOOST_STATIC_CONSTANT(int, min_exponent = LDBL_MIN_EXP);
- };
-#endif // __OpenBSD__
-
- inline void hash_float_combine(std::size_t& seed, std::size_t value)
- {
- seed ^= value + (seed<<6) + (seed>>2);
- }
-
-// A simple, non-portable hash algorithm for x86.
-#if defined(BOOST_HASH_USE_x86_BINARY_HASH)
- inline std::size_t float_hash_impl(float v)
- {
- boost::uint32_t* ptr = (boost::uint32_t*)&v;
- std::size_t seed = *ptr;
- return seed;
- }
-
- inline std::size_t float_hash_impl(double v)
- {
- boost::uint32_t* ptr = (boost::uint32_t*)&v;
- std::size_t seed = *ptr++;
- hash_float_combine(seed, *ptr);
- return seed;
- }
-
- inline std::size_t float_hash_impl(long double v)
- {
- boost::uint32_t* ptr = (boost::uint32_t*)&v;
- std::size_t seed = *ptr++;
- hash_float_combine(seed, *ptr++);
- hash_float_combine(seed, *(boost::uint16_t*)ptr);
- return seed;
- }
-
-#else
-
- template <class T>
- inline std::size_t float_hash_impl(T v)
- {
- int exp = 0;
-
- v = boost::hash_detail::call_frexp(v, &exp);
-
- // A postive value is easier to hash, so combine the
- // sign with the exponent.
- if(v < 0) {
- v = -v;
- exp += limits<T>::max_exponent -
- limits<T>::min_exponent;
- }
-
- // The result of frexp is always between 0.5 and 1, so its
- // top bit will always be 1. Subtract by 0.5 to remove that.
- v -= T(0.5);
- v = boost::hash_detail::call_ldexp(v,
- limits<std::size_t>::digits + 1);
- std::size_t seed = static_cast<std::size_t>(v);
- v -= seed;
-
- // ceiling(digits(T) * log2(radix(T))/ digits(size_t)) - 1;
- std::size_t const length
- = (limits<T>::digits *
- boost::static_log2<limits<T>::radix>::value - 1)
- / limits<std::size_t>::digits;
-
- for(std::size_t i = 0; i != length; ++i)
- {
- v = boost::hash_detail::call_ldexp(v,
- limits<std::size_t>::digits);
- std::size_t part = static_cast<std::size_t>(v);
- v -= part;
- hash_float_combine(seed, part);
- }
-
- hash_float_combine(seed, exp);
-
- return seed;
- }
-#endif
-
- template <class T>
- inline std::size_t float_hash_value(T v)
- {
-#if defined(BOOST_HASH_USE_FPCLASSIFY)
- using namespace std;
- switch (fpclassify(v)) {
- case FP_ZERO:
- return 0;
- case FP_INFINITE:
- return (std::size_t)(v > 0 ? -1 : -2);
- case FP_NAN:
- return (std::size_t)(-3);
- case FP_NORMAL:
- case FP_SUBNORMAL:
- return float_hash_impl(v);
- default:
- BOOST_ASSERT(0);
- return 0;
- }
-#else
- return v == 0 ? 0 : float_hash_impl(v);
-#endif
- }
- }
-}
-
-#if defined(BOOST_MSVC)
-#pragma warning(pop)
-#endif
-
-#endif

Copied: trunk/boost/functional/hash/detail/float_functions.hpp (from r49648, /trunk/boost/functional/detail/float_functions.hpp)
==============================================================================
--- /trunk/boost/functional/detail/float_functions.hpp (original)
+++ trunk/boost/functional/hash/detail/float_functions.hpp 2008-11-09 07:03:45 EST (Sun, 09 Nov 2008)
@@ -3,8 +3,8 @@
 // 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_FUNCTIONAL_DETAIL_FLOAT_FUNCTIONS_HPP)
-#define BOOST_FUNCTIONAL_DETAIL_FLOAT_FUNCTIONS_HPP
+#if !defined(BOOST_FUNCTIONAL_HASH_DETAIL_FLOAT_FUNCTIONS_HPP)
+#define BOOST_FUNCTIONAL_HASH_DETAIL_FLOAT_FUNCTIONS_HPP
 
 #include <boost/config/no_tr1/cmath.hpp>
 

Copied: trunk/boost/functional/hash/detail/hash_float.hpp (from r49648, /trunk/boost/functional/detail/hash_float.hpp)
==============================================================================
--- /trunk/boost/functional/detail/hash_float.hpp (original)
+++ trunk/boost/functional/hash/detail/hash_float.hpp 2008-11-09 07:03:45 EST (Sun, 09 Nov 2008)
@@ -7,8 +7,8 @@
 // http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1756.pdf
 // issue 6.18.
 
-#if !defined(BOOST_FUNCTIONAL_DETAIL_HASH_FLOAT_HEADER)
-#define BOOST_FUNCTIONAL_DETAIL_HASH_FLOAT_HEADER
+#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
@@ -22,7 +22,7 @@
 #endif
 #endif
 
-#include <boost/functional/detail/float_functions.hpp>
+#include <boost/functional/hash/detail/float_functions.hpp>
 #include <boost/integer/static_log2.hpp>
 #include <boost/cstdint.hpp>
 #include <boost/limits.hpp>

Modified: trunk/boost/functional/hash/hash.hpp
==============================================================================
--- trunk/boost/functional/hash/hash.hpp (original)
+++ trunk/boost/functional/hash/hash.hpp 2008-11-09 07:03:45 EST (Sun, 09 Nov 2008)
@@ -12,8 +12,8 @@
 
 #include <boost/functional/hash_fwd.hpp>
 #include <functional>
-#include <boost/functional/detail/hash_float.hpp>
-#include <boost/functional/detail/container_fwd.hpp>
+#include <boost/functional/hash/detail/hash_float.hpp>
+#include <boost/detail/container_fwd.hpp>
 #include <string>
 
 #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)

Modified: trunk/libs/functional/hash/doc/changes.qbk
==============================================================================
--- trunk/libs/functional/hash/doc/changes.qbk (original)
+++ trunk/libs/functional/hash/doc/changes.qbk 2008-11-09 07:03:45 EST (Sun, 09 Nov 2008)
@@ -69,5 +69,9 @@
 
 * Changed the warnings in the deprecated headers from 1.34.0 to errors. These
   will be removed in a future version of Boost.
+* Moved detail headers out of `boost/functional/detail`, since they are part of
+ functional/hash, not functional. `boost/functional/detail/container_fwd.hpp`
+ has been moved to `boost/detail/container_fwd.hpp` as it's used outside of
+ this library, the others have been moved to `boost/functional/hash/detail`.
 
 [endsect]

Modified: trunk/libs/functional/hash/test/container_fwd_test.cpp
==============================================================================
--- trunk/libs/functional/hash/test/container_fwd_test.cpp (original)
+++ trunk/libs/functional/hash/test/container_fwd_test.cpp 2008-11-09 07:03:45 EST (Sun, 09 Nov 2008)
@@ -3,7 +3,7 @@
 // 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)
 
-#include <boost/functional/detail/container_fwd.hpp>
+#include <boost/detail/container_fwd.hpp>
 
 #if BOOST_WORKAROUND(__GNUC__, < 3) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
 template <class charT, class Allocator>


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk